In our setup we check changes into Gerrit
and they don't make it into origin
, which is where we check out from, until they get peer reviewed.
As I am new to the whole Git/Gerrit stuff, after I pushed my changes into Gerrit, I actually went to clean up some local branches and actually deleted the branch I pushed the change from. So now I no longer have a local copy of my changes but they are in Gerrit. They are not in Git as they have not been peer reviewed yet.
So I went to restore my local changes by checking a new branch out of Gerrit and not the Git origin. Our remote config looks as follows
>git remote -v
gerrit ssh://myuser@domain:port/server (fetch)
gerrit ssh://myuser@domain:port/server (push)
origin ssh://myuser@domain:port/server.git (fetch)
origin ssh://myuser@domain:port/server.git (push)
I tried
>git checkout -b gmaster gerrit/refs/heads/master
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'gerrit/refs/heads/master' which can not be resolved as commit?
How do I check out a branch out of Gerrit that will include my change which I accidentally wiped out locally?