git根据某个commit创建分支


git checkout  commit_ID 切换到对应的commit

[root@devops itrafficFront]# git checkout e72378370354786e954bb1bd752dc2c1f566f512
Note: checking out 'e72378370354786e954bb1bd752dc2c1f566f512'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD 目前位于 e723783... 修改解析状态错误bug

//基于此commit创建hainan分支并切换到hainan分支
[root@devops itrafficFront]# git checkout -b hainan
切换到一个新分支 'hainan'
[root@devops itrafficFront]# git branch 
  develop
* hainan

//推送到远程
[root@devops itrafficFront]# git push -u origin hainan

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM