How does git-review work?

11,476

From the fine manual:

When you submit a change, git review does the following things:

  • it looks up which branch to push to (production or whatever) in the .gitreview file. If it can't find this information, it pushes to master
  • it figures out what "topic" to put on the revision (you can set the topic manually with -t)
    • if you're resubmitting a downloaded change, it will reuse the tag of the original change
    • if your commit summary contains a bug number like bug 12345, the tag will be bug/12345
    • otherwise, the tag will be the name of your local branch
  • it rebases your change against the HEAD of the branch you're pushing to (use -R to skip this)
  • if you are submitting more than one change at once, or submitting a change that's based on another unmerged change, it will ask you whether you really meant to do that (use -y to skip this)
  • it pushes the change for review
Share:
11,476
Yo Yo Money Singh
Author by

Yo Yo Money Singh

Updated on July 25, 2022

Comments

  • Yo Yo Money Singh
    Yo Yo Money Singh almost 2 years

    I want to know, how exactly does git review command work? I mean does it use git push command (internally) or something else to upload the changes to gerrit. This information would be useful for me while writing git hooks for git review.

  • Shashi Ranjan
    Shashi Ranjan about 7 years
    What is the location of .gitreview file? And what to edit?