在没有切换到git的情况下合并到一个分支 [英] Merging to a branch in git without switching to it
本文介绍了在没有切换到git的情况下合并到一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个应用程序运行在分支的git仓库中(比如 dev
)。应用程序修改某些存储库中的内容并提交它们。我现在必须将这些更改合并到另一个分支(比如说 master
),但是我不希望 git checkout master
在做这件事之前。有什么方法可以说合并当前分支到主?
I have an application running in a git repository on a branch (say dev
). The application modifies the content in some the repository and commits them. I now have to merge these changes into another branch (say master
) but the snag is that I don't want to git checkout master
before doing this. Is there some way to say "merge current branch into master"?
推荐答案
您的案例中的主似乎是快速转发。你可以推分支来掌握。
The "master" in your case appears to be "fast-forwardable". You could "push" the branch to master.
cd /path_to_dir_with_no_branch_switch/
git push . appbranch:master
这篇关于在没有切换到git的情况下合并到一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文