LoginSignup
3
3

More than 5 years have passed since last update.

git alias設定

Last updated at Posted at 2018-10-13

他にもあるけど以下の設定は多用する。
なお、hubがインストールされている前提。

~/.gitconfig
[alias]
  see=!hub browse -- pull/$(git symbolic-ref --short HEAD)
  d = !git branch --merged | grep -vE '^\\*|master$|develop$' | xargs -I % git branch -d %
  end = !"f() { git checkout $1; git pull; git d; }; f"
  pro = !git push -u origin $(git symbolic-ref --short HEAD) && git see

git end

一番使うのはgit end developとかgit end master
どういう挙動になるかというと、git end masterの場合masterブランチにcheckoutした後、マージされたブランチを消す。これでgit branchなどで余計なブランチが表示されなくなるので便利。

git pro

hub pull-requestでエディタでPRできるけど、自分はフロントエンドエンジニアでPRにスクショを貼るとかするのが多いのでGitHub上で編集したい。
git proすると、今いるブランチの内容がpushされた後ブラウザでPRのページが開く。プルリクエストを送るときは基本これを使っている。


他に便利なalias設定があれば教えてくだい :pray:

3
3
0

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
3
3