Relationship between git commits and review items in Gerrit
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.
- Git rm all that says “deleted by us” during a merge
- Visual Studio 2013 - git checkout
- Git change base branch
- Git : Head commit in remote repository is crap - how exactly should I go about replacing it?
- Install docker in vagrant
- What do you do when you find a bug in other function when develop a function?
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?
One Solution collect form web for “Relationship between git commits and review items in Gerrit”
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.