No changes made error when trying to push multiple commits

333 views
Skip to first unread message

Nir Arbel

unread,
Aug 12, 2015, 1:54:51 AM8/12/15
to Repo and Gerrit Discussion
Where I work, I often have to create commits on top of other unmerged commits as it takes a while for my code to be reviewed and merged. This usually works well, but I sometimes run into a problem when I do something like this:

1. Check out a gerrit commit that's based on three other commits using git fetch && git checkout, let's say the unmerged commits from latest to oldest are 4, 3, 2, 1.
2. Create a new branch from the checked-out commit.
3. Set the master branch as remote and do a pull rebase.
4. Resolve conflicts in 2 and 4 and successfully finish the rebase.
5. Try to do a git push origin HEAD:refs/for/master which gives me a remote rejected, no changes made error because it's not detecting any changes in commit 1. 

Any way I can get around this?

Thanks much, Nir

Björn Pedersen

unread,
Aug 12, 2015, 5:33:32 AM8/12/15
to Repo and Gerrit Discussion


Am Mittwoch, 12. August 2015 07:54:51 UTC+2 schrieb Nir Arbel:
Where I work, I often have to create commits on top of other unmerged commits as it takes a while for my code to be reviewed and merged. This usually works well, but I sometimes run into a problem when I do something like this:

1. Check out a gerrit commit that's based on three other commits using git fetch && git checkout, let's say the unmerged commits from latest to oldest are 4, 3, 2, 1.
2. Create a new branch from the checked-out commit.
3. Set the master branch as remote and do a pull rebase.
 
   do you mean: git branch --set-upstream-to=origin/master 
   Then after the rebase commit 1 should get pushed again.
   If you do a git rebase -i you should not see commit 1!

Björn

Marcin Cieslak

unread,
Aug 12, 2015, 6:54:43 AM8/12/15
to Nir Arbel, Repo and Gerrit Discussion
can you publish actual commands and their output?

what happens if you only push commit 1 first (git push gerrit 1:refs/for/master) ?

~Marcin
Reply all
Reply to author
Forward
0 new messages