LoginSignup
0
0

git fetch vs pull fetchとpullの違い

Posted at

背景

Git でfetchとpullのやりたきことが似ているのでどういう使い分けをしたらいいのか整理したいと思った

画像で整理

大まかに言うと、以下画像のような違いがある
ブランチ整理.png

git fetchを使うケース

fetchだけをした状態だと、リモート追跡ブランチを最新の状態にする。
ローカルブランチにまでは影響が無いので、コンフリクトも発生しない。
ローカルリポジトリに反映させるには、git mergeをする必要がある

コンフリクトが発生した時はgit fetchだけして解消する

git pullを使うケース

fetchとmergeを一気に行いたい時

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