GIT: Squash (Comitting multiple files to gerrit under one review)

I am showing here how to push multiple files under one gerrit review.

Pre-requisites: You need commit-msg hook configured in your local repository.
1- scp -p -P :hooks/commit-msg .git/hooks/
2- curl http:/:port/tools/hooks/commit-msg

Steps:
1- Work and commit usually in your local copy
2- git rebase -i HEAD~6 (6 is the numbers of version you want to squash together)
3- pick base version and replace "squash" for "pick" for the commits you want to squash together. All squashed commits will go together with the "pick" one into gerrit review.
3- Modify changeId in rebase process when asked (make sure changeId should be same as that of already created review process)
4- push to gerrit

No comments:

Post a Comment

Scheduling Repeating Local Notifications using Alarm Manager

Learn about Scheduling Repeating Local Notifications using Alarm Manager in this post .