Switched to a new branch
#git checkout命令加上-b参数表示创建并切换,相当于以下两条命令
git branch dev
git checkout dev
#Switched to branch ‘dev’
git checkout -b local-name origin/remote-name
How to change commit comment:
git commit --amend -m “your new comment”
How to change commit user:
git commit --amend --author “your new name”
Config yuor email:
git config --global user.email you@domain.com
Show settings:
git config --list
Push
$ git push <远程主机名> <本地分支名>:<远程分支名>
git push -u origin
## Merge Process
-
git checkout master -b work
-
git merge
-
在这里处理冲突
-
git commit
-
git checkout master
-
git merge work --squash --ff-only / git merge --squash -Xignore-space-change
-
git commit
-
git push
-
git branch -d work
undo revert a commit
git reset --hard HEAD
unpush commit
git log origin/master…HEAD
git diff origin/master…HEAD
undo/revert merge:
git merge --abort