场景:
在远程库创建分支后,在本地开发后-合并代码-push到远程库
命令行
bash
#查看现在分支
git branch
#切换到master分支
git checkout master
#拉取远程库修改
git pull
git branch
#切换到修改的分支
git checkout feature/s3-use-internel-name
#merge远程master的修改到本分支
git merge master
git branch
#git push
#将现有分支与master分支之间的多次修改合并为一次修改
git log --oneline origin/master..feature/s3-use-internel-name
git reset --soft `git merge-base origin/master feature/s3-use-internel-name`
git status
git diff --cached
#利用某次commit的描述
git commit -c ff67xxxxxxxx3c8
git branch
git push --force-with-lease
#git push -f origin feature/s3-use-internel-name
#添加tag
git tag v2.1.0 -m "Version 2.1.0"
git push origin v2.1.0