Always Keep in mind Git fetch and git Git pull are used to download new data from a remote repository. but,
Git Fetch:- It is only downloading the new updates from the remote repository - but it will not integrate any of these new updates into your working files.
Command - $ git fetch origin
Git Pull:- git pull is used to update your current MAIN branch with the latest changes from the remote server. That pulls not only downloads new updates it also directly integrates them into your current working copy files.
Command - $ git pull origin master
git pull
does a git fetch
followed by a git merge
.You can do a git fetch
at any time to update your remote-tracking branches under refs/remotes/<remoteAdd>/
. This operation never changes any of your own local branches under, and is safe to do without changing your working copy. I have even heard of people running git fetch
periodically in a cron job in the background (although I wouldn't recommend doing this).
A git pull
is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.
Git Fetch:
Git fetch is a command that allows you to download objects from another repository.
Git Pull:
Git pull is a command that allows you to fetch from and integrate with another repository or local branch.
* Be the first to Make Comment