1

I dont have a branch called master in my git repository but when i do post-review command (rbtools addon for git) , its pointing to master branch though i point mainBranch branch

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=ssh://****
branch.mainBranch.remote=origin
branch.mainBranch.merge=refs/heads/main
reviewboard.url=https:**
tracking.branch=origin/mainBranch

command issued from dev branch to post code review against mainBranch :

post-review --parent mainBranch

Error :

   >  git merge-base origin/master refs/heads/dev Failed to execute command:
 ['git', 'merge-base', 'origin/master', 'refs/heads/dev']
    > fatal: Not a valid object name origin/master

Above error clearly shows it is trying to post review against master branch which is not present in my git repo. But i have mainBranch . i need to point to mainBranch so that the command works. i am not sure where to change this in git config or rbtools config ? Please suggest

FYI - RBT tools : https://www.reviewboard.org/docs/rbtools/dev/

bahrep
  • 29,961
  • 12
  • 103
  • 150
logan
  • 7,946
  • 36
  • 114
  • 185

1 Answers1

0

When using Git, rbt post makes the assumption that the closest upstream branch for the diff will be origin/master. You can use --tracking-branch option to get around the error

post-review --tracking-branch=mainBranch

https://www.reviewboard.org/docs/rbtools/dev/rbt/commands/post/#tracking-branches

Ajit Kumar
  • 490
  • 5
  • 9