Git-Flow
Installation
- Install Plugins on MacOS
1 | brew install git-flow |
- search git-flow plugin
reflog
1 | git reflog |
Tag
create tag
1 | git tag branch tag_name |
push tag
1 | git push --tags |
view tag
1 | git tag -l |
sync tag
1 | git fetch origin --prune --tags |
delete tag
delete all tags in remote
1
git tag -l | xargs -n 1 git push --delete origin
delete all tags in local
1
git tag | xargs git tag -d
delete a tag
1 | git push --delete origin tagname |
Branch
查看分支
查看本地分支
1 | git branch |
分支带有**前缀表示当前所在分支
查看远程分支
1 | git branch -r |
查看本地和远程分支
1 | git branch -a |
创建分支(不包含分支切换)
1 | git branch new_branch |
空白分支1
2git checkout --orphan branch-name
git rm -rf .
删除分支
删除本地分支
1 | # -D 强制 |
删除远程分支
1 | git branch -d -r branch |
重命名分支
1 | # -M 强制 |
切换分支
1 | git checkout branch |
合并分支代码
1 | git merge origin/dev |
Rollback
1 | git reset --hard id |