I'm a super-massive fan of time/labour saving devices, and that goes for command-line tips n' tricks to save me: -
(a) typing more stuff
(b) looking in my notes to remember what I need, in order to type more stuff
Therefore, I've finally got around to creating an alias to create a new branch in a GitHub repo that I've cloned to my Mac.
I've added this alias to ~/.zprofile: -
gitbranch='git fetch origin && git rebase origin/master && git checkout master; git checkout -b $1'
so now I just need to type: -
gitbranch foobar
or: -
gitbranch snafu
in order to create a new branch ...
Which is nice.
No comments:
Post a Comment