cyne
cyne

Reputation: 1

Is it possible to checkout git remote branch to gerrit based workspace?

I have created git local branch and pushed to remote server.

    git push origin git_based_branch_test

Then I updated my current workspace with repo init/sync to update to Gerrit based repository. All my local branches created using git commands is gone.

   repo start <git_based_branch_test>

is getting created as new branch without my earlier changes. So can help me how to pull git_based_branch_test using repo start ?

Upvotes: 0

Views: 3868

Answers (1)

Execute the following inside the repository and you'll create a local git_based_branch_test tracking the remote git_based_branch_test (origin/git_based_branch_test)

$ git fetch
$ git checkout git_based_branch_test

Branch git_based_branch_test set up to track remote branch git_based_branch_test from origin by rebasing.
Switched to a new branch 'git_based_branch_test'

Upvotes: 1

Related Questions