Skip to content

Instantly share code, notes, and snippets.

@tamanugi
Last active May 8, 2017 01:29
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 tamanugi/02e58d75c873cd2e70ef406842846774 to your computer and use it in GitHub Desktop.
Save tamanugi/02e58d75c873cd2e70ef406842846774 to your computer and use it in GitHub Desktop.
[Git]カレントブランチをブランチ名を指定せずにプッシュする ref: http://qiita.com/tamanugi/items/e9e4ef6c2c492d841499
$ git push origin HEAD
$ git config --global push.default simple
$ cat ~/.gitconfig | grep default # Use the Git 1.x.x default to avoid errors on machines with old Git
# `git config --global push.default simple`. See http://git.io/mMah-w.
default = simple
$ git rev-parse --abbrev-ref HEAD
$ git push origin $(git rev-parse --abbrev-ref HEAD)
$ git push origin (git rev-parse --abbrev-ref HEAD)
$ balias gpoc 'git push origin (git rev-parse --abbrev-ref HEAD)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment