On 16-04 16:25, Henning Westerholt wrote:
On Thursday 16 April 2009, Jan Janak wrote:
[..]
$ git push
and in that case repository 'origin' is used.
The opposite of 'git push' is 'git pull'. This is the operation that you
can use to synchronize your local repository with the remote repository.
Hi Jan,
i've one question to the usage of git pull. I've encountered it a few times,
everytime when somebody commited something to the repository, i did a git
pull to update my repo as well. This merged the changes into my repository,
as wanted, no problem here.
But, it also show this changes as new commits, as changed files for example
when i do git status, or git diff, where i clearly did not changed anything.
Perhaps this is just normal, do you've an explanation for this?
Yes, git pull does two things internally. First, it runs 'git fetch', this is
a command which connects to the remote server, retrieves missing commit from
the database there and stores them in the database in the local repository.
'git fetch' does not modify the source files in any way, it only retrieves
commits from a remote repository.
After that 'git pull' runs 'git merge', which takes the newly received
commits
from the local database and merges them into the current branch. It takes all
commits that are missing your your current branch and applies them one after
another. This is why you see them in the history. At the end it will also
create a special "merge commit" which records what was merged from where so
that you can see what happened in the history.
Jan.