What is the difference between 'git remote upd

2020-02-16 07:04发布

I'm starting to play with Git now and I'm a little bit confused. For me, looks like there are a lot of options to do the same thing. My question for now is what is the difference between the commands below:

  • git remote update
  • git fetch
  • git pull

Also which one is more applicable for update a local copy of a remote branch?

标签: git
2条回答
▲ chillily
2楼-- · 2020-02-16 07:14

Not sure about the git remote update, but git pull is the git fetch followed automatically by a git merge...

This is partially a duplicate. Check: What is the difference between 'git pull' and 'git fetch'?

Also, if it means anything to you, I've never used git remote update neither fgit fetch. You can do just fine with pull, commit and push.

Hope it helps..

查看更多
3楼-- · 2020-02-16 07:21

git remote update will update all of your branches set to track remote ones, but not merge any changes in.

git fetch will update only the branch you're on, but not merge any changes in.

git pull will update and merge any remote changes of the current branch you're on. This would be the one you use to update a local branch.

查看更多
登录 后发表回答