amphibient
amphibient

Reputation: 31230

Relationship between git commits and review items in Gerrit

When I git commit to my local branch, I like to commit one file at a time so that I can put in a commit message dedicated to that file only. I just got done working on a task and I changed 8 files total, each of which was its own commit with its own commit message.

When I pushed my local branch into Gerrit, that created 8 code review items, not what I wanted. I wanted a single review item with the 8 file changes bundled together.

Q1: Does one git commit mean one Gerrit review item?

Q2: How do I undo my push into Gerrit?

Q3: How do I make it work so that I have individual file commits and commit messages but a single review item when it is pushed into Gerrit?

Upvotes: 1

Views: 840

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 993085

A1: Yes, a Gerrit review item is created for each commit that you push.

A2: To undo your push into Gerrit, use the "Abandon" button in Gerrit for each of your review items.

A3: You will need to squash your multiple commits into one commit before pushing to Gerrit. Use git rebase -i to rewrite your commits into one, then push to Gerrit.

Upvotes: 2

Related Questions