I installed and configured my own Gerrit server. I created a repository using the web gui for Gerrit. I am able to clone this empty repository succesfully using the "git" command, so the configuration seems to be fine. Next, I:
configured my access:
git config --global user.email ...
,git config --global user.name ...
,added remote:
git add remote origin myUser@myGitHost:29418/project.git
,created and commited file:
git add file
, gitcommit -m "first commit"
.
So far so good.
But, when I try to push it to my repo, I get output:
myUser@myGitHost:~/project$ git push origin master
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 525 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done
To ssh://myUser@myGitHost:29418/project.git
! [remote rejected] master -> master (can not update the reference as a fast forward)
error: failed to push some refs to 'ssh://myUser@myGitHost:29418/project.git'
I tried to look for solution. The "git pull origin master
" does not work. Pushing with -f
option isnt working too.
Can anyone help me?
EDIT: The output of push -f:
myUser@myGitHost:~/project$ git push -f origin master
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 525 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done
To ssh://myUser@myGitHost:29418/project.git
! [remote rejected] master -> master (can not update the reference as a fast forward)
error: failed to push some refs to 'ssh://myUser@myGitHost:29418/project.git'
What I mean by The "git pull origin master" is that the most solution ppl mention is to do a pull before push, for example: http://rip747.wordpress.com/2009/04/20/git-push-rejected-non-fast-forward/. This pull outputs:
myUser@myGitHost:~/project$ git pull origin master
From ssh://myGitHost:29418/project
* branch master -> FETCH_HEAD
Already up-to-date.
But when I do a push, the output is still the same:
can not update the reference as a fast forward.
push -f
. What do you mean, thatpull origin master does not work
? – Tudor