Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Script for creating tracking branches on `origin`
  2. ---
  3.  
  4. The script attempts to be agnostic to both git version and `gitconfig`
  5. settings.
  6.  
  7. To mimic the script in a git alias, run the following command:
  8.  
  9. ```
  10. git config -g alias.mkbranch '!foo() { git fetch origin && git checkout -b $1 ${2:-origin/master} && git push -u origin $1:$1; }; foo'
  11. ```
  12.  
  13. Alternatively, copy or create a symlink from this script to somewhere in
  14. your `$PATH` and give it the name `git-mkbranch` for the same effect:
  15.  
  16. ```
  17. ln -s /path/to/script/git-mkbranch.sh ~/bin/git-mkbranch
  18. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement