Skip to content

Instantly share code, notes, and snippets.

@Kuniwak
Created August 12, 2014 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kuniwak/92f655cde33e60ee62e4 to your computer and use it in GitHub Desktop.
Save Kuniwak/92f655cde33e60ee62e4 to your computer and use it in GitHub Desktop.
peco と alias -g で git に便利革命おきた ref: http://qiita.com/Kuniwak/items/b711d6c3e402dfd9356b
$ git commit
$ git pull
$ git push
$ git push -u origin feature/something-great
$ g p
$ g pu
$ g puu R B
$ git config --global alias.p 'pull'
$ git config --global alias.pu 'push'
$ git config --global alias.puu 'push -u'
alias -g R='`git remote | peco --prompt "GIT REMOTE>" | head -n 1`'
$ git remote add origin git@github.com/my/repo
$ g r add origin H
$ brew install jq
$ git config --global alias.r 'remote'
alias -g H='`curl -sL https://api.github.com/users/YOUR_USERNAME/repos | jq -r ".[].full_name" | peco --prompt "GITHUB REPOS>" | head -n 1`'
$ git checkout -b feature/something-great remotes/origin/feature/something-great
alias g='git'
$ git config --global alias.b 'checkout -b'
alias -g LR='`git branch -a | peco --query "remotes/ " --prompt "GIT REMOTE BRANCH>" | head -n 1 | sed "s/^\*\s*//" | sed "s/remotes\/[^\/]*\/\(\S*\)/\1 \0/"`'
$ brew tap peco/peco
$ brew install peco
$ brew install jq
$ git config --global alias.c 'commit -v'
$ git config --global alias.o 'checkout'
$ git config --global alias.b 'checkout -b'
$ git config --global alias.p 'pull'
$ git config --global alias.pu 'push'
$ git config --global alias.puu 'push -u'
$ git config --global alias.r 'remote'
alias g='git'
alias -g B='`git branch -a | peco --prompt "GIT BRANCH>" | head -n 1 | sed -e "s/^\*\s*//g"`'
alias -g R='`git remote | peco --prompt "GIT REMOTE>" | head -n 1`'
alias -g H='`curl -sL https://api.github.com/users/YOUR_USERNAME/repos | jq -r ".[].full_name" | peco --prompt "GITHUB REPOS>" | head -n 1`'
alias -g LR='`git branch -a | peco --query "remotes/ " --prompt "GIT REMOTE BRANCH>" | head -n 1 | sed "s/remotes\/[^\/]*\/\(\S*\)/\1 \0/"`'
$ git config --global alias.c 'commit -v'
$ git checkout feature/something-great
$ brew tap peco/peco
$ brew install peco
$ git config --global alias.o checkout
alias -g B='`git branch -a | peco --prompt "GIT BRANCH>" | head -n 1 | sed -e "s/^\*\s*//g"`'
$ alias -g IS_GOD='`echo path/to/file`'
$ vim IS_GOD
# vim path/to/file と等価
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment