Git - Fetching Changes

From EdWiki

GitLab - Fetching Changes

  • Goals
    Learn how to pull changes from a remote repository.
cd ../cloned_hello
git fetch
git hist --all

NOTE: Now in the cloned_hello repo

At this point the repository has all the commits from the original repository, but they are not integrated into the the cloned repository’s local branches.

Find the “Changed README in original repo” commit in the history above. Notice that the commit includes “origin/master” and “origin/HEAD”.

Now look at the “Updated Makefile” commit. You will see that it the local master branch points to this commit, not to the new commit that we just fetched.

The upshot of this is that the git fetch command will fetch new commits from the remote repository, but it will not merge these commits into the local branches.

  • Check the README
    We can demonstrate that the cloned README is unchanged.

See, no changes.