The git project is a distributed version control system. It can do everything that a centralized version control system can do, and more. Benefits include allowing collaboration without a centrally managed host and the ability to take full advantage of the version control system while online or off.
If you would like to start using the CSE git server all you need to do is send the following information to help@cse and we will create a project for you.
This section describes how to use git at CSE.
The git server uses SSH public key authentication. This means that you need to generate a public and private key (if you haven't already) and send the public portion (usually ending in .pub) to the help@cse.
There are a few URLs that are used for this service.
For pulling from a public repository you can use the URL: git://vcs.cse.ucdavis.edu/REPONAME where REPONAME is replaced with the repository name.
If you have commit access (read and write) you should authenticate using your ssh key and use the following URL: email@example.com:REPONAME where REPONAME is replaced with the repository name. This method communicates over TCP port 22 (ssh).
You can allow anonymous or authenticated web browsing of a repository. You can access the repository using the following URL: https://vcs.cse.ucdavis.edu/git/REPONAME.git where REPONAME is replaced with the repository name. This service runs over the TCP/443 port (HTTPS).
There are a few steps that need to be completed before you can commit to your repository.
This is somewhat outside of the scope of this document. Most Linux distributions support git out of the box. You can search the web for how to install git on your laptop/workstation.
http://help.github.com/win-set-up-git/ is a link to configuring GIT and ssh keys in the Windows environment. You can stop at step 4 under “Set Up SSH Keys”. At this point you just need to send us (firstname.lastname@example.org) your public key.
Although there are a lot of more valuable resources available on the web here are a few shortcuts.
Once the project has been added, and you are ready to import your code. Run the following to import the code in your current directory into the trunk.
$ git clone email@example.com:REPONAME $ cd REPONAME $ mkdir modules $ cp /tmp/mymodule REPONAME/modules/mymodule $ git add REPONAME/modules/mymodule $ git commit -a -m "adding my module" # commits changes to local git repo $ git push origin master # push the changes back to the server
If you want to change the source code you have to first clone it.
$ git clone firstname.lastname@example.org:REPONAME
To check in changes changes to your source tree you need to commit them to the local git repository. Don't forget to git add any files added since the last commit. This works offline and offers most of the advantages of a centralized version control system except surviving a local disk crash.
Unlike all centralized version control systems you do not need to be “online” to do this with git.
$ git commit -a -m "updated module a to use inline assembly"
With git you can push your committed changes to a remote repository using the push command. This will make the remote repository look just like yours, including a full history of any local changes.
$ git push
With git you can pull any remotely made changes into your repository. This will make your repository look like the remote repository.
$ git pull
Here are a few websites offering more help on the topic of Git and Gitolite.
This section is intended for administrators.
This section is targeted at the git admins. We use gitolite to manage git repositories. To create a repo you need to first clone the gitolite-admin repository.
$ git clone email@example.com:gitolite-admin $ cd gitolite-admin/conf $ vi gitolite.conf $ git commit -a -m "created new repo testProject and gave user JoeCommit commit access" $ git push # this will actually push the changes
An example repo entry:
repo testProject # create repo with name testProject RW = JoeCommit # add JoeCommit to users that can commit R = gitweb # provide world readable web browsing interface for that user R = daemon # provide world readable git cloning test "test project owner" = "test project description"
Now the new repository will be available for users.
# for anonymous/random users that wants a copy: $ git clone git://vcs.cse.ucdavis.edu:testProject # for someone with commit access that wants a copy: $ git clone firstname.lastname@example.org:testProject # for someone that wants to browse the world readable repo with gitweb: $ firefox https://vcs.cse.ucdavis.edu/git/testProject.git