使用idea git cherry-pick, 將一個分支的commit, git push到另一個分支


idea git cherry-pick

什么是git cherry-pick?

把A分支上的一些commit, git push到另一個分支B.

用idea進行git cherry-pick

下面將分支annotation-processor上的一些commit, git push到另一個分支master.

1 首先, 切換到想要git push的分支master

2 把annotation-processor分支上的一些commit進行git cherry-pick

調出git history, 選擇需要git cherry-pick的分支annotation-processor;

使用ShfitCtrl選擇多個commit, 然后右鍵, 接着點擊cherry-pick.

3 把剛才git cherry-pick的commit, git push到master分支

使用Ctrl+Shift+K快捷鍵或者git push 剛才git cherry-pick的commit.

由於我的idea設置是cherry-pick之后自動commit, 所以我直接git push就行了.

如果沒有上面的這個設置, 先commit, 再push就行了.

這樣就做到了將分支annotation-processor上的一些commit, git push到另一個分支master.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM