If you have to set up a public repository with git you can follow the instruction found on the git-core tutorial
(Hint: Search for “Publishing your work”)
Things to keep in mind:
- Public repository are usually named as
project.git and it’s a directory even if you can be mislead to think it’s a file for the extension (.git). Well, it’s not a file.
- you need to login in the remote host (the one from which you will share your repo) and initialized a local git database:
- ssh account compulsory
- git should be in the path and available in the web server
- You need an ssh account over there.
- Then you can push your changes to the new shiny repo.
The steps to do that:
- login the remote <public-host>
GIT_DIR=my-git.git git init
- mv project.git/hooks/post-update.sample project.git/hooks/post-update This make sure that after every push the git update-server-info is ran and your repo can be accessed in the public way.
git push <public-host>:/path/to/project.git master
Questo video di Zoro è un pugno. Netto…
On this page on the GNOME website I found how to use git properly if you are using it as a gateway to a svn:
git svn clone _svn_server_location #Clone the repository
git svn fetch #Download the stuff
git svn rebase #Merge the updates with the current
git checkout -b myfeature #Create a local branch
- hack hack hack # hack
git commit -am "changed stuff" # Commit
- hack hack hack # hack
git commit -am "changed other stuff" # Commit
git checkout master # Change to master branch
git merge --squash myfeauture #Merge myfeature to master
git commit -am "merge the feature to the master"
git svn dcommit # Commit everything on the svn server
More info about git in the previous posts
Git rocks, and after two days of using I can confirm it.
I was a user of bazar, but with the switching of GNOME to git and the big trouble that bazar was giving me to commit on the svn of the EBI I decided to give to git a go.
Also on bioinfoblog the match between git and bazar it’s a though one, but I right now the svn support from git just works out of the box, so I started to use it.
I want also to point out that with the last git (ATMOW) is possible to create a remote branch on the svn server with:
git svn branch mybranch
and this was one of the killer feature that made me switch.
This is not a tutorial on git but I will provide you some quick and dirty pointers to other posts that I found interesting for a quick introduction to git.
Stuff to keep in mind about git:
- You always work in a local branch.
- You commit locally
- You push (or dcommit if using a remote svn repository) to the remote branch.
- The name of a remote branch is remote/foobar and you need to put the remote prefix also if it doesn’t show up with the remote prefix not optional. You need this if you create a local branch and you want to track a remote branch.
Some pointers here:
I’ve customized my bash prompt to show my current branch on a git repository. This is the code (based on some code found on the net that I can’t track anymore.. I’m sorry….) looks like this:
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
The terminal looks like this