现在我开始玩Git了,而且我有点困惑。对我而言,看起来有很多选项可以做同样的事情。现在我的问题是下面的命令有什么不同:
还有哪一个更适用于更新本地副本一个远程分支?
解决方案git remote update 分支设置为跟踪远程分支,但不合并任何更改。
git fetch 将只更新您的分支',但不会合并任何更改。
git pull 会更新和合并当前分支的任何远程更改。这将是您用来更新本地分行的人。
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 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.
更多推荐
'git remote update','git fetch'和'git pull'有什么区别?
发布评论