Git基础命令(三)

2018-03-29  本文已影响0人  mibenxin

分支

git branch dev
git branch
git branch -d dev
git branch -D dev
git branch --set-upstream <branch-name> <origin/branch-name>

切换分支并更新工作区

git checkout dev
git checkout -b dev
git checkout -d dev
git checkout -b <branch-name> <origin/branch-name>
git checkout <file>

合并分支

git merge dev
git merge --no-ff -m "merge with no-ff" dev

储藏工作现场

git stash
git stash list
git stash apply stash@{0}
git stash drop stash@{0}
git stash pop stash@{0}

标签

git tag <tag_name>
git tag <tag_name> <commit_id>
git tag -d <tagname>
git tag -a <tag_name> -m "<descriptive text>"
git show <tag_name>
git push origin :refs/tags/<tagname>
git tag
git tag -s <tagname> -m "<descriptive text>"
上一篇 下一篇

猜你喜欢

热点阅读