Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git review doesn't work? but I am able to see my changes when I do a push. What am I doing wrong?

Tags:

git

I am using git and gerrit. After changing my files, I do the following:

  1. git status
  2. git add -> the modified files.
  3. git commit -m "the commit message"
  4. git review
  5. git push

When I go git review: I get the following error message "No '.gitreview' file found in this repository. We don't know where your gerrit is. Please manually create a remote named gerrit and try again.

But when I do git push, I can see all my changes on the remote.i.e. the commit is made there. But I am not sure what's wrong.

Any thoughts or leads appreciated.

I already created gerrit when I was installing git/gerrit.

like image 602
NewUser07 Avatar asked Oct 09 '13 19:10

NewUser07


Video Answer


2 Answers

The gerrit command git review expects that you have a remote repository set up named gerrit. If you already have your repository as a remote named origin (the default from a git clone), you can rename it to what git review expects with this:

git remote rename origin gerrit

like image 171
pmitchell Avatar answered Sep 17 '22 17:09

pmitchell


Before using git review you should configure the remote repository name. It's defaulted to gerrit. But you might want to change this default to origin as most repositories are called origin.

Simply call:

git config --global --add gitreview.remote origin

You might want to remove --global if it only applies for a single project.

This works for version 1.2.5 or newer.


For versions 1.2.4 or earlier add a gitreview config file: .config/git-review/git-review.conf
(Windows: %USERPROFILE%\.config\git-review\git-review.conf)

With this content:

[gerrit] defaultremote = origin

like image 27
Sven Döring Avatar answered Sep 20 '22 17:09

Sven Döring