Difference between revisions of "Using git@school"

From Klaus' wiki
Jump to: navigation, search
(Create the remote project)
(Create the remote project)
Line 58: Line 58:
 
Now you have an empty git repository containing one empty file ''afile''.
 
Now you have an empty git repository containing one empty file ''afile''.
  
To push the project onto the git-server issue:S
+
To push the project onto the git-server issue:
 
<source lang="bash">
 
<source lang="bash">
 
$ git remote add origin git@git-server:<your-projectname>
 
$ git remote add origin git@git-server:<your-projectname>

Revision as of 13:58, 22 August 2013

git is available for you to store and share your projects.

The is a local git-server - a virtual machine running on top of bren. It is known on bren.

User creation

Note:The following instructions requires you to perform them on bren, i.e. log-in to bren.

In order to be able to store projects on git-server you need to be created on the server.

If you haven't done it already, you have to create a ssh key-pair - see Linux hints how to create your ssh key-pair.

Next issue this command:

$ cd /home/git-server
$ mkdir <your username>
$ chmod 700 <your username>
$ cd <your username>
$ cp ~/.ssh/id_rsa.pub <your username>.pub
$ vi projectname

For every <your username> you will of-course put in your login on bren.

when the editor opens add these lines:

[group <your groupname>]
writable = <your projectname>
members = <your username>
 
[group <your groupname_ro>
readable = <your projectname>
members = <member names>

where the last group is not necessary if nobody shall be able to just read the project without being able to write back.

You can add several usernames if needed - you should just provide one username.pub file per username in the same directory.

Finally you write a mail to klausk (at) iha [dot] dk asking to have the entries created on the git-server. When you receive an email back everything should be working.

Create the remote project

On bren create a project directory in your home directory or below that.

cd into the directory.

Issue:

$ git init
$ touch afile
$ git add afile
$ git commit -m 'a message'

Now you have an empty git repository containing one empty file afile.

To push the project onto the git-server issue:

$ git remote add origin git@git-server:<your-projectname>
$ git push origin master
</source<
 
If no errors your project is now master on the git-server and you can push changes or pull earlier versions.