I’m new to Git. I’ve successfully pushed and merged two commits. But when I check the git status, it still says that
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
no changes added to commit (use "git add" and/or "git commit -a")
Output after git push (*** is company Git server address, which is ignored below):
$ git push
Total 0 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done
To ssh://***
! [remote rejected] master -> refs/for/master (no new changes)
error: failed to push some refs to 'ssh://***'
Does somebody know why?
Error message mentioning
refs/for/mastersuggests that you are pushing to Gerrit code review server. While Gerrit is fully compliant Git server, it has special rules to follow.Please refer to Gerrit documentation on how to properly submit code reviews.
Probably even better idea would be to ask your company’s Git/Gerrit admin on how to upload your commits properly.
In any case, note that changes you upload to Gerrit will not become official (and will not move
origin/masterbranch) until they are approved by someone using Gerrit web interface.Once approved in Gerrit, you should be able to see changes when you do
git fetch(orrepo sync) next time.