git - Merge branches without checking out branch -
i have 3 branches.
master [ live server] \ stage [ stage server test changes; merge commits ] \ dev [ local machine ]
i downstream changes to. each of these branches set tracking each other.
normally, downstream changes this:
git checkout stage && git merge master
then checkout dev , same
git checkout dev && git merge stage
then push them all: git push origin --all
is there way downstream changes without checking out each branch?
i maybe using wrong terminology. i'm not totally sure if i'm using upstream/downstream terminology correctly.
you can indeed "merge" branch b branch without having check out branch a, but if it's fast-forward merge.
you can use refspec fetch
"merge". if merging branch b branch using git merge
result in fast-forward merge, can following without having checkout a:
git fetch <remote> b:a
the documentation
the above matches refspec format
git fetch <remote> <source>:<destination>
from the documentation git fetch
(emphasis mine):
the remote ref matches
<src>
fetched, , if<dst>
not empty string, the local ref matches fast-forwarded using<src>
.
Comments
Post a Comment