Difference between revisions of "Git"

From Ontohub
Jump to: navigation, search
(Access to a git repository)
Line 1: Line 1:
[http://en.wikipedia.org/wiki/Git_%28software%29 git] is a decentralised version control system. Ontohub uses git for maintaining [[repositories]] of ontologies.
+
[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 Git repository==
 
==Access to a Git repository==

Revision as of 10:36, 3 February 2014

Git is a decentralised version control system. Ontohub uses git for maintaining repositories of ontologies.

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 have the permissions for the repository and have uploaded an SSH key, you can also use the "clone with git-ssh" URL for cloning. Then you will have access as specified by the permissions (e.g. you could have write access, while with access for anyone, you only would get read access, or you could have read access, while with access for anyone, you would get no access at all).

Working with a git repsoitory

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].