If I might suggest a refinement to the new script,
I was getting irritated at always ending up on the master branch after running it. So I put
oldbranch=$(git symbolic-ref --short -q HEAD)
before each pull & push section, and
git checkout $oldbranch
after.
It seems to work for me, but I haven't updated the wiki because I suck at git and at bash scripting, and I don't want to break other peoples' hacks! In particular, it will probably do weird things if either repo has a detached HEAD. If anybody who does know what they're doing with bash would like to refine this to do it properly, I'd be most grateful :-)
no subject
I was getting irritated at always ending up on the master branch after running it. So I put
oldbranch=$(git symbolic-ref --short -q HEAD)
before each pull & push section, and
git checkout $oldbranch
after.
It seems to work for me, but I haven't updated the wiki because I suck at git and at bash scripting, and I don't want to break other peoples' hacks! In particular, it will probably do weird things if either repo has a detached HEAD.
If anybody who does know what they're doing with bash would like to refine this to do it properly, I'd be most grateful :-)