This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 8: Robots and remote clones

Summary

face Josiah Wang

As a summary, git clone can be used to create a local copy of an existing remote repository.

Use git pull (or git fetch followed by git merge) to keep your local repository up-to-date with the remote repository. You should do this often, especially before you start making any changes and if you are collaborating with someone else on the same repository. This will avoid any potential conflicts that might be hard to resolve.

If you already have your Imperial College username, you can follow the instructions on this page to access your own account and create your own repositories.

Otherwise, you can wait until you obtain a College username before creating a repository. If you just cannot wait, you can create your personal GitHub account and create a new repository (you can make it private if you do not want other people accessing it).

The interface for creating a new repository on these sites should be straightforward. You can then clone your new repo to your own hard drive and play around with it.

You can try updating a file on the remote repository (you can do this on GitLab/GitHub directly using the web interface), so that you can experiment with git pull or git fetch to try to understand how it works.

You can even clone a second copy to a different local folder, and see how both behave independently of each other, and how they can be synced to the remote version.

This activity is optional - this is more for you to get a better feel of how local and remote repository work. I will expect that you will be doing lots of git pull anyway throughout your degree.