Here are some web references for git usage:
git-scm.com/documentation
kernel.org/pub/software/scm/ … anual.html
gnome.org/~federico/news-200 … with-git-1
gnome.org/~federico/news-200 … with-git-2
morevnaproject.org/wiki/Contributor%27s_Guide
Also here is my .git/config file:
genete-config.txt (776 Bytes)
And the instructions I followed to migrate from svn to git (including the branches at repo.cz - dooglus git repo-):
git-migration-zelgadis.txt (5.92 KB)
Finally a guide from my own:
1) If you regularly will do commits you’ll probably want to become a synfig project member at sourceforge. If you aren’t, please register to SF and ask us to give you write permit to the code.
2) Other wise if you just want to send us some patches you only need to clone the repository, do your changes and create a diff file.
3) Clone the repo:
carlos@pcnuevo:~/Software/test$ git clone ssh://genete@synfig.git.sourceforge.net/gitroot/synfig
Initialized empty Git repository in /home/carlos/Software/test/synfig/.git/
genete@synfig.git.sourceforge.net's password:
remote: Counting objects: 32972, done.
remote: Compressing objects: 100% (8980/8980), done.
remote: Total 32972 (delta 24420), reused 32073 (delta 23654)
Receiving objects: 100% (32972/32972), 15.12 MiB | 214 KiB/s, done.
Resolving deltas: 100% (24420/24420), done.
Replace ‘genete’ with your user name at sf.net.
At this point you’ll have all the remote branches plus a local branch ‘master’ that is pointing to the remotes/origin/master branch. The rest of remote branches are development ones.
Check them all with:
carlos@pcnuevo:~/Software/test$ cd synfig
carlos@pcnuevo:~/Software/test/synfig$ gitk --all
In the menu select: File-> List of References
Also you can verify the content of the configuration file at ‘synfig/.git/config’
This is the initial config file:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://genete@synfig.git.sourceforge.net/gitroot/synfig
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
4) Add your local branches that tracks remote ones.
Imagine that you want to develop a new branch based on one remote existing one.
Run git gui. But don’t run it from a console. Run it from the menu. It would prompt the password in a small window instead in the console. I was crazy until I realized that it was waiting for my password in the console
Then in git gui select Branch->Create. It would prompt a dialog window like this:
See how I inserted the branch name (‘my_branch’) and selected to track a remote branch, in this case remotes/origin/master.
Once created and with the options like the image above you’ll be with ‘my_branch’ checked out.
Now let’s examine the config file:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://genete@synfig.git.sourceforge.net/gitroot/synfig
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "my_branch"]
remote = origin
merge = refs/heads/master
As you can see there is a new entry telling that ‘my_branch’ is tracking the remote master branch.
It is a bad example beacuse for that type of modifications (straightforward onto the master branch) you don’t need a branch because you already have your local ‘master’ branch created automatically.
The equivalent command of the steps above is:
carlos@pcnuevo:~/Software/test/synfig$ git branch --track my_branch2 origin/master
Branch my_branch2 set up to track remote branch refs/remotes/origin/master.
carlos@pcnuevo:~/Software/test/synfig$
5) More branches for large modifications.
Maybe you need to do a lot of commits before to have a stable version of your fix or added feature. To do that it is better to create a remote branch and track it locally and keep it safe remotely. Once you are happy with your modifications you can merge (or rebase the pending on the situation you are) your branch with the master one, and incorporate your changes to the main line.
Checkout the base branch:
$ git checkout master
Create a branch
$ git branch genete_test
Checkout it
$git checkout genete_test
Fetch your current branch to the repo. It will create a remote tracking branch.
$git push origin genete_test
Notice how used ‘origin’. This means: push my local branch “genete_test” to remote server identified as “origin” in the config file
The current code:
[code]carlos@pcnuevo:~/Software/test/synfig$ git branch
- genete_test
master
my_branch
my_branch2
pepe
carlos@pcnuevo:~/Software/test/synfig$ git branch genete_test2
carlos@pcnuevo:~/Software/test/synfig$ git push origin genete_test2
genete@synfig.git.sourceforge.net’s password:
Total 0 (delta 0), reused 0 (delta 0)
To ssh://genete@synfig.git.sourceforge.net/gitroot/synfig - [new branch] genete_test2 -> genete_test2
carlos@pcnuevo:~/Software/test/synfig$ [/code]
Now do some code modifications:
carlos@pcnuevo:~/Software/test/synfig$ cd autobuild
carlos@pcnuevo:~/Software/test/synfig/autobuild$ ls
api.sh trunk
carlos@pcnuevo:~/Software/test/synfig/autobuild$ gedit api.sh
carlos@pcnuevo:~/Software/test/synfig/autobuild$ git commit -a
Created commit 38db89b: Test commit
1 files changed, 1 insertions(+), 1 deletions(-)
And push your commits to the remote branch
carlos@pcnuevo:~/Software/test/synfig/autobuild$ git push sf genete_test2
genete@synfig.git.sourceforge.net's password:
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 369 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
To ssh://genete@synfig.git.sourceforge.net/gitroot/synfig
f869a45..38db89b genete_test2 -> genete_test2
Once you finish your modifications in your development branch you can merge it to master
$ git checkout master
$ git merge genete_test2
$ git push
(obviously I won’t do it in real life like the previous examples)
And you’re done.
I hope all this mess help someone.
-G