Before going through the steps, lets first understand what is the purpose of GIT Pull ?
In simple terms, GIT PULL is a GIT Command which access the Remote repository and checks which all files were modified or created and is different from the local repository. Once it finds that info, it downloads those file to your local repository.
Technically speaking, GIT Pull runs 2 commands i.e GIT Fetch and GIT Merge in background. GIT Fetch downloads the latest change to the local repository while GIT Merge merges the remote content refs and heads to new local merge commit.
so you can say the below is same :
GIT Pull <remote>
-or-
GIT Fetch <remote>
GIT Merge origin/master
So lets begin with the steps on how to see the remote (origin/master) changes before doing Git Pull :
Git fetch origin Git log master..origin/master Git diff master..origin/master Git pull / Git merge origin/master |
Comments
Post a Comment