git在一个命令中合并 [英] git merge in one command
问题描述
我现在住在A分支.我想将分支A合并为分支B并切换到分支B,如何在一个命令中做到这一点?
I'm now staying at branch-A. I want to merge branch-A into branch-B and switch to branch-B, how can I make this in one command?
现在,我必须检出branch-B,并将branch-A合并到自身中. B/c我在合并时保持IDE处于打开状态.当我签出另一个分支时,ide(xcode)可以赶上文件的更改,并且通常会崩溃.我进行的合并通常与快进一起进行.因此,我想知道是否有一种无需更改文件即可进行快进合并的方法,只需将HEAD和branch-B(通常是dev分支)设置为最新提交,
Now I have to checkout branch-B ,and merge branch-A into itself. B/c I kept the IDE opened while merging.when I checkout another branch, the ide(xcode) can catch up the files' changing, and crashes usually. The merge I made usually goes with fast-forward.So I'm wondering if there is a way to make fast-forward merge without files' changing,just set the HEAD and branch-B(usually dev branch) to the lastest commit,thx
推荐答案
Provided the merge is fast forward, you can solve the IDE problem by Merging to a branch in git without switching to it before switching to the merged-to branch. Then doing it in 1 command can be achieved by aliasing.
这篇关于git在一个命令中合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!