GitInfo – TracDoc at trac.fzj



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
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 master

push to global repository gittestBlessed

git push 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)
 * [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.
   eddcc8f..c800e2a  master     -> origin/master
Updating eddcc8f..c800e2a
 testclient.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

try to push to gittestBlessed, resolve conflict

git push master
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ''
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

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