-
Notifications
You must be signed in to change notification settings - Fork 0
git review d
tulpar008 edited this page Mar 29, 2015
·
2 revisions
Date:2015-03-29 Title: git 复习巩固(4) Tags:git Category:It
##### 新建分支
git branch branch-name
git checkout -b branch-name
$ git branch -d experimental
$ git branch -D crazy-idea
git merge branch-name
100% (4/4) done
Auto-merged file.txt
CONFLICT (content): Merge conflict in file.txt
Automatic merge failed; fix conflicts and then commit the result.
有冲突(conflicts)的文件会保存在索引中,除非你解决了问题了并且更新了索引,否则执行 git commit都会失败:
git commit
file.txt: needs merge
放弃修改撤回到本分支头部
git reset --hard HEAD
或
git checkout -f
撤回到之前的commit
git reset 4ba467213eb73480431b95c7dba03aac1c7a2c26