Skip to content

Instantly share code, notes, and snippets.

View Feh's full-sized avatar

Julius Plenz Feh

View GitHub Profile
@Feh
Feh / git-ff-track
Created October 24, 2010 13:12 — forked from esc/git-ff-track
#!/bin/bash
# fast-forward local tracking branch if you get something like (on git checkout):
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
# Author: Valentin Haenel <valentin.haenel@gmx.de>
# Licence: wtfpl <http://sam.zoy.org/wtfpl/>
BRANCH=$( git branch | grep ^* | cut -f1 -d' ' --complement )
if [[ -z $BRANCH ]] ; then
# not a git repository
exit 1