LoginSignup
24
23

More than 5 years have passed since last update.

git pullせずにgit upする

Posted at

git pullした時リモートに変更があると、rebaseが面倒でmergeコミットしてtreeを汚くしちゃってたんだけど、git-upというツールを使うとfast-forwardできない時は自動でrebaseしてくれて便利だった。
aanand/git-up

git pull has two problems:

It merges upstream changes by default, when it's really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.
It only updates the branch you're currently on, which means git push will shout at you for being behind on branches you don't particularly care about right now.

gem install git-upしたらすぐ使える。

リモートの変更を取り込む時にgit pullではなくgit upを実行するようにする。

スクリーンショット 2014-09-11 13.08.00.png

↑masterを自動的にrebaseできた。更にカレントブランチ以外もpull/rebaseしてくれている。

またコミットしていないファイルがある状態でgit upしたときは、自動でstashして変更を取り込んだ後にunstashしてくれたりもする。
スクリーンショット 2014-09-11 13.24.35.png

pull/rebaseの使い分けだけならpull --rebaseオプション付けるのでも良いかなと思ったけど、それ以外にもこういった便利機能があって良い。

24
23
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
24
23