12
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git でどすこいする方法

Last updated at Posted at 2015-01-30

社内で、git push って相撲の突き出しみたいだよね、という話が出たので、そういうエイリアスを書けば良いじゃんと言う流れになった。

export remote='origin'
alias dosukoi='git push ${remote} `git rev-parse --abbrev-ref HEAD`'

↑のを、.bashrc に書いて

source ~/.bashrc

すると、

$ dosukoi
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 324 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@hogehogehost:fuga/tsukareta.git
 * [new branch]      feature/hoge -> feature/hoge

どすこいできる!!!!
(なお、私自身は動作未検証です)

他のリモートホストにpushするときは、

export remote=nanika;dosukoi

どすこいできる!!!!
(なお、動作未検証です。あと、originに戻すときは、さきにexportしてね)

ノリだけで乗り切りたい。
突っ込み待ちです。

12
9
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?