Re: best way to fastforward all tracking branches after a fetch
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Dec 11, 2011, 02:22 UTC
- Message-ID
- <20111211022218.GA22749@sita-lt.atc.tcs.com>
- In-Reply-To
- <jbvj5o$skt$1@dough.gmane.org>
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