0

Issue with pushing changes to remote repo

asked 2015-03-31 03:33:50 -0700

dvs gravatar image

I follow step from this page — https://wiki.allseenalliance.org/develop/contributing_source_code

I create branch, make commit with right message (according the link above) and try to push it for review.

But

To https://git.allseenalliance.org/gerrit/core/alljoyn
 ! [remote rejected] feature/asacore-1666 -> feature/asacore-1666 (prohibited by Gerrit)
error: failed to push some refs to 'https://git.allseenalliance.org/gerrit/core/alljoyn'

How to find out what I'm doing wrong?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2015-03-31 12:35:44 -0700

You don't need a feature branch for a bug fix in general. Unless the fix is large and/or needs multiple commits, push the fix to the master branch. Commits must go through code review which requires you to push to refs/for/master, not directly to master. See below for an example:

git checkout -t origin/master
# make your changes
git add -u
git commit -s 
git push origin HEAD:refs/for/master
edit flag offensive delete publish link more

Comments

When doing this it is best to make sure that your changes are actually on master when you push them to Gerrit refs/for/master; otherwise you might end up pushing more changes than you realize (I inadvertently changed the version numbers by pushing a change I had made on master to a release branch).

marcello ( 2015-03-31 12:47:47 -0700 )edit

Thank you. It's small changes for few issues. And I thinking that it's better to put changes to the separated branches to be able apply this changes independently. Do I right understand, that I could make changes in separated commits, and next commit could contain changes from my previous commit?

dvs ( 2015-03-31 13:00:59 -0700 )edit

yes, you can chain commits if you like.

ry.jones ( 2015-03-31 13:09:23 -0700 )edit

You can choose whether your commits are independent.
To make them independent:
$ git checkout origin/master
(make changes)
$ git commit
$ git push origin HEAD:refs/for/master
$ git checkout origin/master
(make different changes)
$ git commit
$ git push origin HEAD:refs/for/master
Skip the second checkout if you want to make the second commit depend on the first.

mathewm ( 2015-03-31 13:17:01 -0700 )edit

On a slightly different note: greatly appreciate you taking this on Vladimir!

marcello ( 2015-03-31 13:24:34 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-03-31 03:33:50 -0700

Seen: 54 times

Last updated: Mar 31 '15