GIT is a distributed version control system.
Core concepts:
For a simple repository:
git clone https://code.cor-lab.org/git/rsc.git rsc
For a repository containing submodules:
git clone --recursive https://code.cor-lab.org/git/rsb.git rsb
A cloned repository contains all revisions of its software with all branches and the user needs to select a branch he wants to have available at the moment. Therefore, he needs to checkout the respective branch.
Listing available branches:
git branch -a
For a simple repository (e.g. rsc):
git checkout 0.7 # 0.7 being the branch name
For a repository containing submodules (e.g. rsb, rst) this can be done recursively:
git submodule foreach git checkout 0.7
git submodule foreach git pull --rebase
The additional pull step (see below) is necessary as the repository containing the submodules points to a specific revision and not the latest one in each branch. Therefore, we need to get the most recent changes in the branch.
Getting the latest changes from the server
git pull --rebase
Note
By using --rebase local commits (not yet pushed to the remote server) are applied again after fetching all revisions from the remote repository. Otherwise and intermediate branch would be created and merged back directly.
Commiting changes
git add {files to commit}
git commit
Warning
Committing in GIT is not comparable to committing in SVN. Eventhough your commit has created a new revision, this revision is only available in your local clone of the repository. You still need to push it back to the server. So do not forget the next step!
Pushing local changes back to the remote repository
git push