0
0

More than 3 years have passed since last update.

masterをpull出来ない。

Last updated at Posted at 2020-05-08

出来事

masterを最新にするために、pullしよとしたら出来ない‥

masterにブランチ移動する際、ターミナルに、

Your branch is behind 'origin/master' by 23 commits, and can be fast-forwarded.
 (use "git pull" to update your local branch)
sekishinya@mba gyakuten_clone_group13 % git branch

のように表示されますが、masterブランチでコミットしてはいけません

commitしてもpushできなくしていますが、履歴がおかしくなります。

解決策

何か変更があるかどうか、状態を確認する。

git status

それで何かが表示されたら、一旦stashで一時保存する。

git stash

そうすれば差分がなくなりpullできます。ブランチを切った後に反映をしたい場合は次のコマンドでOKです。

git stash pop
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