LoginSignup
0
0

More than 3 years have passed since last update.

git pullしたら怒られた・・(git 2.27)

Last updated at Posted at 2021-05-01

git pullするとこんなエラー文が

分岐しているリポジトリを一致させる方法を、指定しないことはおすすめできません。pullする前にこのいずれかのコマンドを実行してください。

という事が書かれており、3つコマンドが提示されています。

warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Git 2.27.0 から pull をすると表示されるようです

pullした際に、pull --rebase や pull --ff-only の挙動を期待していたユーザーが意図しないマージコミットを作ってしまうことを避けるために、このようなエラーが出るらしい。

rebase false が良さそう

下記のコマンドを実行することで、デフォルトのpullの挙動になる。

git config pull.rebase false

rebaseの際に、明示的に --rebase をつける設定です。

git config pull.rebase true

逆に上記設定にすると、pullしただけで、 pull --rebase をするようになります。

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