Information

Author(s) Mathieu Jadin
Deadline No deadline
Submission limit No limitation

Sign in

Git: Synchronize the local copy with the remote one

When you work in a team, it might happen that new commits are present in the repository but not in your local history, such as:

https://inginious.org/course/git/git-pull/git-before-pull.svg

You need to pull the remote modifications to your main branch .As you have no local commit that is not present in the remote branch pull only updates the local branch.

https://inginious.org/course/git/git-pull/git-after-pull.svg

Now, let's imagine that you have a local commit unpushed to the remote copy:

https://inginious.org/course/git/git-pull/git-before-pull-2.svg

If you use pull, git will automatically create an additional commit that will merge both branchs together.

https://inginious.org/course/git/git-pull/git-after-pull-2.svg

You then need to push the new commit onto the remote branch to finish the synchronization.

https://inginious.org/course/git/git-pull/git-after-push-2.svg

The corresponding command is git pull (see documentation).


Download the archive which already contains a cloned repository in the subfolder clone. Synchronize it with its remote repository. Afterwards, zip the whole folder and upload it.

The message of the merge commit has to be "MERGE".

Note that the remote repository in this exercise is not on GitHub or Bitbucket but inside the folder bare.git of the archive.

Your submission needs to respect the following hierarchy:

git-pull/
├── bare.git/
|   └── [...]
└── clone/
    └── [...]

Max file size: 1.0 MiB
Allowed extensions: .zip