Difference between revisions of "Git"
(Created page with "[http://en.wikipedia.org/wiki/Git_%28software%29 git] is a decentralised version control system. Ontohub uses git for maintaining repositories of ontologies. ==Access to ...") |
(→Access with permissions: better explanation) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [http://en.wikipedia.org/wiki/Git_%28software%29 | + | [http://en.wikipedia.org/wiki/Git_%28software%29 Git] is a decentralised version control system. Ontohub uses Git for maintaining [[repositories]] of ontologies. |
− | ==Access to a | + | ==Access to a Git repository== |
===Access for anyone=== | ===Access for anyone=== | ||
− | On the main page of a repository, you find a "clone with | + | On the main page of a repository, you find a "clone with Git" URL for cloning the repository. At the command line, with |
git clone <URL> | git clone <URL> | ||
− | you can create a local copy of the repository on your computer. (If you have a graphical interface for | + | you can create a local copy of the repository on your computer. (If you have a graphical interface for Git, enter the URL at the appropriate place for cloning). |
Note that you will have only limited access to the repository, depending on its access type (for private repositories, you won't have any access, for public readable repositories, you will have read access, for public readbale and writable repositories, you also will have write access). | Note that you will have only limited access to the repository, depending on its access type (for private repositories, you won't have any access, for public readable repositories, you will have read access, for public readbale and writable repositories, you also will have write access). | ||
===Access with permissions=== | ===Access with permissions=== | ||
− | If you have | + | If you want to have also write access, then you have to uploaded an [[SSH keys|SSH key]], and use the "clone with git-ssh" URL for cloning. Then you will have access as specified by your [[permissions]]: e.g. you get write access to an otherwise read-only repository, or you get read access to an otherwise private repository. You will also get write access to all public writable repositories - you won't need any permissions for that, but you still need to upload your ssh key (this is needed for protection against Spam). |
− | ==Working with a | + | ==Working with a Git repository== |
The usual working cycle is: | The usual working cycle is: | ||
* make some local changes | * make some local changes | ||
Line 24: | Line 24: | ||
==Read more== | ==Read more== | ||
− | Documentation of | + | Documentation of Git and a try-out tour can be found at [http://gitscm.com/]. |
Latest revision as of 10:21, 24 February 2014
Git is a decentralised version control system. Ontohub uses Git for maintaining repositories of ontologies.
Contents
Access to a Git repository
Access for anyone
On the main page of a repository, you find a "clone with Git" URL for cloning the repository. At the command line, with
git clone <URL>
you can create a local copy of the repository on your computer. (If you have a graphical interface for Git, enter the URL at the appropriate place for cloning). Note that you will have only limited access to the repository, depending on its access type (for private repositories, you won't have any access, for public readable repositories, you will have read access, for public readbale and writable repositories, you also will have write access).
Access with permissions
If you want to have also write access, then you have to uploaded an SSH key, and use the "clone with git-ssh" URL for cloning. Then you will have access as specified by your permissions: e.g. you get write access to an otherwise read-only repository, or you get read access to an otherwise private repository. You will also get write access to all public writable repositories - you won't need any permissions for that, but you still need to upload your ssh key (this is needed for protection against Spam).
Working with a Git repository
The usual working cycle is:
- make some local changes
- add the new and changed files using "git add <files>". With "git add .", you add everything.
- if needed, remove files using "git rm <files>".
- commit your changes using "git commit" or "git commit -m <message>"
- push your changes to the ontohub server with "git push"
- if someone else has pushed in the meantime, you have to get his/her commits first, using "git pull". This will merge both commits. Note that nothing can get lost, you can always restore your commit if needed.
Pushing to an empty repository
In this case, you need to use "git push origin master"
Read more
Documentation of Git and a try-out tour can be found at [1].