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>.

see also

  1. git checkout , merge without touching working tree

  2. merge, update, , pull git branches without using checkouts

  3. merging without changing working directory

  4. merging branches without checkout


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -