Difference between revisions of "Git"

From HPC users
Jump to navigationJump to search
m (removed section with broken link)
(adding information about local usage)
 
Line 14: Line 14:


[http://markmcb.com/2008/10/18/3-reasons-to-switch-to-git-from-subversion/ 3 reasons to switch to git from subversion ]
[http://markmcb.com/2008/10/18/3-reasons-to-switch-to-git-from-subversion/ 3 reasons to switch to git from subversion ]
== Using git at the University of Oldenburg and the local HPC cluster ==
At the University Oldenburg git repositories can be managed using [https://about.gitlab.com/ GitLab]. Documentation on how to use GitLab can found under https://gitlab.uni-oldenburg.de/help. After you have logged in with your university account you can create projects (git repositories) and manage access permission for those projects. Once a project is created you can clone on your local machine or the cluster using one of the following commands:
1. Login with ssh: in this case you need to add a public ssh-key in GitLab as described in the documentation. After that the command
git clone git@gitlab.uni-oldenburg.de:abcd1234/myproject.git
will create a copy of the repository in the local directory <tt>myproject</tt>. The exact command depends of course on your user name and the name of the project (the web interface of GitLab allows you to copy the address of the project for the <tt>git clone</tt>-command).
2. Using https: in this case only the password of the account is needed (do not give your password to others! manage access permissions in GitLab). The command
git clone <nowiki>https://abcd1234@gitlab.uni-oldenburg.de/abcd1234/myproject.git</nowiki>
(with your user and project name) will prompt you for your password.
In both cases you now start working on the cloned repository, make and commit changes, track changes and so on. Note that almost everything is done locally (in contrast to e.g. Subversion (svn)), see explanations above.

Latest revision as of 15:48, 10 February 2016

git is a distributed version control system. In contrast to Subversion (svn) there are many possibilities to organise your workflow.

Different workflows

An overview on possible workflows is given at the git-scm.org  :

The most important commands

A basic introduction to git can be found here (in German): http://wiki.ubuntuusers.de/Git#Entwicklung-mit-Git

Differences between git and svn

git is completely different from other version control systems like svn. A brief overview of these differences can be found by following the links beneath:

5 fundamental differences between git and svn

3 reasons to switch to git from subversion

Using git at the University of Oldenburg and the local HPC cluster

At the University Oldenburg git repositories can be managed using GitLab. Documentation on how to use GitLab can found under https://gitlab.uni-oldenburg.de/help. After you have logged in with your university account you can create projects (git repositories) and manage access permission for those projects. Once a project is created you can clone on your local machine or the cluster using one of the following commands:

1. Login with ssh: in this case you need to add a public ssh-key in GitLab as described in the documentation. After that the command

git clone git@gitlab.uni-oldenburg.de:abcd1234/myproject.git

will create a copy of the repository in the local directory myproject. The exact command depends of course on your user name and the name of the project (the web interface of GitLab allows you to copy the address of the project for the git clone-command).

2. Using https: in this case only the password of the account is needed (do not give your password to others! manage access permissions in GitLab). The command

git clone https://abcd1234@gitlab.uni-oldenburg.de/abcd1234/myproject.git

(with your user and project name) will prompt you for your password.

In both cases you now start working on the cloned repository, make and commit changes, track changes and so on. Note that almost everything is done locally (in contrast to e.g. Subversion (svn)), see explanations above.