Thread (24 messages) flat view 24 messages, 9 authors, 2016-06-15

Re: best way to fastforward all tracking branches after a fetch

From: Sitaram Chamarty <hidden>
Date: 2016-06-15 22:52:36

On Sat, Dec 10, 2011 at 01:26:32PM +0100, Gelonida N wrote:
Hi,

What is the best way to fastforward all fastforwardable tracking
branches after a git fetch?
I dont think there is a single command to do it for *all*
branches, but for any particular branch, this should work:

    git merge --ff-only @{u}

So what you want would boil down to this script (untested):

    #!/bin/bash
    git status --porcelain -uno | grep . && {echo dirty tree, exiting...; exit 1; }

    for b in `git for-each-ref '--format=%(refname:short)' refs/heads`
    do
        git checkout $b
        git merge --ff-only @{u}
    done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help