0

I did some changes in my code and after that i did git-review. The changes were on the branch b1 and I created only one commit for these changes. And the changes still unmereged.

After some-days, I deleted this repo from my workspace, and i cloned this repo again.
I see the commit in gerrit, but I don't see on the branch, even after I did git pull --rebase.

What is the reason that I don't see my commit? And how can I fix that (so I will can see it) ?

torek
  • 448,244
  • 59
  • 642
  • 775
  • When you did the commit, did you actually `git push` your changes to the server? When you do a `git commit`, you're only creating something local in your sandbox, you have to push it before it appears on the server and becomes visible to others. – joanis Sep 22 '22 at 11:31
  • @joanis i did `git-review` – user20007266 Sep 22 '22 at 11:39
  • I wasn't familiar with git review, but reading up on it, it seems to do the push for you. The next question, then, is are you sure the push part of your git review happened? Actually, more directly: do you see your commit(s) on the remote server? – joanis Sep 22 '22 at 12:20
  • This is all very Gerrit-specific; generic Git answers won't be useful here. @joanis: `git-review` does a `git push` to `refs/for/`, which is a magic JGit / Gerrit fake ref that makes Gerrit assign or look for a change ID and create a bunch of magic refs that require Gerrit magic to find. – torek Sep 22 '22 at 13:50

1 Answers1

0

If you don't see the commit on the branch I assume it's still on reviewing (it wasn't merged yet). In this case, if you want to see the commit locally in a new repository clone, you need to download the commit explicitly.

  • Go to your Gerrit server;
  • Go to the change page with your commit (which is on reviewing);
  • Click on "DOWNLOAD" (on the middle-right of the page);
  • Choose and copy one of the available commands to download the commit:

enter image description here

All commands will download the commit using different methods, I suggest using the "Checkout" one.

  • Execute the download command in your local repository.