Auth: 王海飞 Data:2018-04-20 Email:779598160@qq.com github:https://github.com/coco369/knowledge
git clone 分支名仓库名地址
一般拉取下来的代码,当前分支都在master分支上
git checkout -b wanghaifei
git status
git add 修改后的文件
git commit -m '注解'
git push origin wanghaifei
git commit -am '注解'
git pull origin wanghaifei
git checkout dev
当前dev分支在合并wanghaifei分支
git merge wanghaifei
提交dev分支合并的代码到远程dev分支上
git push origin dev
git tag -a 版本号 -m '注解'
提交版本v1.0.0.0
git push origin v1.0.0.0
git branch -D wanghaifei
git push origin --delete wanghaifei
git tag -d v1.0.0.0
git push origin --delete tag v1.0.0.0
git diff dev wanghaifei
git stash
缓存之后,在git status去查看修改代码记录会发现提示 nothing to commit,working tree clean。说明刚才修改的代码都缓存起来了
git stash list
发现有缓存列表,刚才缓存的记录为 stash@{0}: XXXXXXXXXX
git stash apply stash@{0}
git log
例如结果提交信息的日志如下:
commit f9838aa51ca5ccd603e1e8cbd347a43c9cd2e0be
Merge: f5847ec 52dc6fa
Author: wanghaifei <779598160@qq.com>
Date: Mon Jan 29 17:15:34 2018 +0800
Merge branch 'whf_p0' into dev
commit 52dc6fa34f36fae981d1c347825af93a150308fa
Author: wanghaifei <779598160@qq.com>
Date: Mon Jan 29 17:15:22 2018 +0800
完成预约增加预约到店时间
git show commit-id
git reset --hard