Git alias solutions!


SUBMITTED BY: Guest

DATE: March 8, 2013, 1:08 p.m.

FORMAT: Bash

SIZE: 708 Bytes

HITS: 1427

  1. # Broken version is at http://www.bitbin.it/q9p6o8bv
  2. --> cat ~/.gitconfig
  3. <snip>
  4. # From https://git.wiki.kernel.org/index.php/Aliases#alias
  5. [alias]
  6. alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"
  7. amend = commit --amend -C HEAD
  8. `--> git config alias.alias
  9. !sh -c '[ $# = 2 ] && git config --global alias."$1" "$2" && exit 0 || echo "usage: git alias <new alias> <original command>" >&2 && exit 1' -
  10. `--> git alias amend "commit --amend -C HEAD"
  11. `--> git config alias.amend
  12. commit --amend -C HEAD
  13. # Success!

comments powered by Disqus