Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script for creating tracking branches on `origin`
- ---
- The script attempts to be agnostic to both git version and `gitconfig`
- settings.
- To mimic the script in a git alias, run the following command:
- ```
- git config -g alias.mkbranch '!foo() { git fetch origin && git checkout -b $1 ${2:-origin/master} && git push -u origin $1:$1; }; foo'
- ```
- Alternatively, copy or create a symlink from this script to somewhere in
- your `$PATH` and give it the name `git-mkbranch` for the same effect:
- ```
- ln -s /path/to/script/git-mkbranch.sh ~/bin/git-mkbranch
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement