GitInfo – TracDoc at trac.fzj
wiki:GitInfo

Git

Documentation

Required git version

git client >= 1.7.1 required

Sample client session

get git repository from private repository gittest on server, add a file afterwards

>git clone https://admin@svn.version.fz-juelich.de/gittest
Initialized empty Git repository in /home/anke/test/gittest/.git/
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.

>echo "test" > test.txt
>git commit -m "testfile added"
>git push https://admin@svn.version.fz-juelich.de/gittest master

push to global repository gittestBlessed

git push https://admin@svn.version.fz-juelich.de/gittestBlessed master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 451 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
To https://admin@svn.version.fz-juelich.de/gittestBlessed
 * [new branch]      master -> master

(modify and push the same file on gittest and gittestBlessed on server)

integrate changes from gittest

> git pull
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://svn.version.fz-juelich.de/gittest
   eddcc8f..c800e2a  master     -> origin/master
Updating eddcc8f..c800e2a
Fast-forward
 testclient.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

try to push to gittestBlessed, resolve conflict

git push https://admin@svn.version.fz-juelich.de/gittestBlessed master
To https://admin@svn.version.fz-juelich.de/gittestBlessed
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://admin@svn.version.fz-juelich.de/gittestBlessed'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

>git commit -a -m"merged"
[master 62de45b] Merge branch 'master' of https://svn.version.fz-juelich.de/gittestBlessed

Last modified 5 years ago Last modified on 07/05/12 10:32:23