- A Version Control System is a software that tracks the file changes of all contributors within a project.
- Originally developed to assist collaborative open source software development by Linus Torvalds (Initiator of Linux development)
- The user chooses which files are tracked and which file changes are recorded.
- All tracked files of a project are stored in a git repository ("repo").
Each line is a commit, a saved state of your project. Each commit has a creator, a time stamp and a message which describes what has been changed in the files of the project.
$ git status
Adding files to the staging area, which will be included in the next commit.
$ git add ham.py
$ git add spam.txt
Creating the commit containing the files in the staging area:
$ git commit -m "edited ham.py, created spam.txt"
Registering your user name and email:
$ git config --global user.name "Alfred Hettner"
$ git config --global user.email "[email protected]"
Note: This has to be done only once. It does not have to be your GitHub user name or email.
$ git log
Note: You can exit the log by typing "q", if you use the default command line editor vim.
Option 1: Clone the repository to your computer:
$ git clone https://github.com/geoscripting/preparatory-assignment-hettner
Option 2: Create a local repository and connect it to a central repository:
$ git init
$ git remote add origin https://github.com/hettner/my_empty_repo.git
The Software Carpentry provides a good git tutorial.