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