Combine osc with git


Yesterday Jan-Simon (dl9pf) tells me about an great Program calls „git“. Git is an Version-Administration Program. Anything knows the Problem. We working on an Project into our osc, and 2 Weeks later, we don’t know, what the last changes was. On this place can git help.Now following a short Introducting:

First of all we need an .git Folder. In my case i have all Projects in ~/osc/- As example i’m going to my foo.

$ ~/osc> cd foo
$ ~/osc/foo> git init
Then git says:
Initialized empty Git repository in /home/sascha/osc/foo/.git/

$~/osc/foo> echo 123 > datei1

$~/osc/foo> git add datei1
This adds datei1 to your .git folder. If you use git add * you can add more than one File.

$~/osc/foo> git commit -m“Initial Version“ (Or what you want)
git says:
Created initial commit a7458cf: Test
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 datei1

$~/osc/foo> echo 456 > datei2
$~/osc/foo> git commit -m“Change 1″
git says:
Created commit d1ef978: Change 1
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 datei2
$~/osc/foo> gitk (this is an GUI)

That looks:

gitk

There you can find all Changes since „Intial Version“.  Git can also manage branches and can merge it perfectly. So i think that git is very good Tool. And an good completion. With an wrapper file it is also possible to add or remove files in osc and git. Very nice -)