Skip to contentSkip to conversation

git-pull-branch script

DISCUSSION Jeff Garzik 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I've attached the 1-line git-pull-branch script that I just whipped together, in case anybody finds it useful.

On occasion, I need to pull one branch into another branch, inside the same repo. For this case, the objects are already present, so we can skip the git-fetch-script step of git-pull-script completely. I also modify the commit message so that we log the fact that we pulled a branch.

#!/bin/sh

git-resolve-script HEAD $1 "pwd branch '$1'"