Git

Git#

Git is first of all a version control software. A version control is a system that records changes to a set of files over time. We want you to use Git because

  • it helps you to synchronize your code among different machines, e.g., a Computer Pool, your laptop and the KI4All cluster.

  • it helps you organizing different versions of code, without tedious copy-pasting of folders.

  • if you break your code, you can easily revert to an older version.

  • you can upload your code to a (private or public) remote repository (i.e. on the Internet). Losing your laptop is annoying enough. Make sure your code, the result of hard work of hours, if not years, is safe!

../../_images/git_computer_exercise.png

Fig. 1 How git is used in iRMB computer exercises: (1) A tutor prepares an exercise on her laptop and publishes a remote repository at https://git.rz.tu-bs.de. (2) Students clone the remote repository onto the pool computers. They push their progress to a private remote repository. (3) Students may clone their private repositories from the remote onto their own computer.#

Prerequisites#

In order to create a repository on your local computer git needs to be installed. Git is available for linux/unix, macOS and Windows systems and can be downloaded here.

Furthermore git needs to be accesible in your terminal. Check it by typing

git --version

Want more?#

This Knowledge Base explains the basic steps of creating a Git repository and accessing your code. A very good and detailed overview about git is provided by the free book Pro Git.