推送所有tag :git push --tags 附git常用命令 查看文件状态 :git status切换分支 :git checkout [分支名]新增文件 :git add [文件名]新增所有文件 :git add -all删除文件 :git rm [文件名]提交代码到本地仓库 :git commit -m "说明"将本地仓库代码推送到远程 :git push 代码回滚:(push前一定检查好,不然回滚有很多坑)查看日志 :git log回滚到上一个版本 :git reset --hard HEAD^到指定版本 :git reset --hard [commit hash] 创建分支创建分支 :git checkout -b [分支名]删除分支 :git branch -d [分支名]推送分支到远程 :git push origin [分支名]关联远程分支 :git push --set-upstream origin [分支名] 合并分支代码整个分支合并:git checkout [被合并的分支名]根据[需求|commit hash]合并: 单个版本号合并:git cherry-pick [commit hash] 多个版本号合并:git rebase (好几种用法,自行百度) 对发布分支打tag(tag名请跟发布分支名保持一致)打tag :git tag -a [tag名] -m "此次tag备注"推送所有tag :git push --tags删除tag :git tag -d [tag名]
附git常用命令
查看文件状态 :git status
切换分支 :git checkout [分支名]
新增文件 :git add [文件名]
新增所有文件 :git add -all
删除文件 :git rm [文件名]
提交代码到本地仓库 :git commit -m "说明"
将本地仓库代码推送到远程 :git push
代码回滚:(push前一定检查好,不然回滚有很多坑)
查看日志 :git log
回滚到上一个版本 :git reset --hard HEAD^
到指定版本 :git reset --hard [commit hash]
创建分支
创建分支 :git checkout -b [分支名]
删除分支 :git branch -d [分支名]
推送分支到远程 :git push origin [分支名]
关联远程分支 :git push --set-upstream origin [分支名]
合并分支代码
整个分支合并:git checkout [被合并的分支名]
根据[需求|commit hash]合并:
对发布分支打tag(tag名请跟发布分支名保持一致)
打tag :git tag -a [tag名] -m "此次tag备注"
推送所有tag :git push --tags
删除tag :git tag -d [tag名]