Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between git remote update and fetch?

Is git remote update the equivalent of git fetch?

like image 518
David Avatar asked Dec 06 '09 20:12

David


People also ask

What's the difference between git pull and git fetch?

git fetch is the command that tells your local git to retrieve the latest meta-data info from the original (yet doesn't do any file transferring. It's more like just checking to see if there are any changes available). git pull on the other hand does that AND brings (copy) those changes from the remote repository.

Does git pull update remote?

git pull is a Git command used to update the local version of a repository from a remote. It is one of the four commands that prompts network interaction by Git. By default, git pull does two things. Updates the remote tracking branches for all other branches.

Should I use git pull or fetch?

When comparing Git pull vs fetch, Git fetch is a safer alternative because it pulls in all the commits from your remote but doesn't make any changes to your local files. On the other hand, Git pull is faster as you're performing multiple actions in one – a better bang for your buck.

What is a git fetch?

Git fetch summary In review, git fetch is a primary command used to download contents from a remote repository. git fetch is used in conjunction with git remote , git branch , git checkout , and git reset to update a local repository to the state of a remote.


1 Answers

Yes and no. git remote update fetches from all remotes, not just one.

Without looking at the code to see if remote update is just a shell script (possible) it, basically, runs fetch for each remote. git fetch can be much more granular.

like image 81
xenoterracide Avatar answered Oct 12 '22 00:10

xenoterracide