uncletall
uncletall

Reputation: 6842

Gerrit and Git workflow

I am looking for some advise on how to do this better. This is the sequence of events:

What would be the best way to handle this? Now the changes were small but if it gets bigger then I don't think it is a good idea to just delete my last commits.

Please advice

Upvotes: 0

Views: 223

Answers (1)

Carl Norum
Carl Norum

Reputation: 224962

Push your changes from a different branch than the one you're tracking on the remote. That is, only update your local master by pulling, and push only from non-master branches. Workflow something like:

git co master                        # switch to master branch
git pull                             # update from origin
git co -b work                       # make a working branch
...                                  # work work work
git commit -m "My #1 commit message" # commit
git push HEAD:refs/publish/master    # push to gerrit for publishing on master
...                                  # wait wait wait
git co master                        # switch to master branch
git pull                             # update...

etc, etc etc.

Upvotes: 1

Related Questions