Simon ([personal profile] swaldman) wrote in [site community profile] dw_dev 2012-09-25 09:42 pm (UTC)

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 :-)

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org