Blocker with Git Branches [Resolved]

I’m sure I’m missing something obvious, but I have read the git manuals and I’m getting no joy at all. Am having work around openmrs-distro-referenceapplication and after cloning its repo am not able to checkout a branch that i want to build locally. I can only see the master branch locally. When I run git branch -a am able to see all the remote branches. Any clue on this!. cc: @k.joseph @dkayiwa

Have tried to git fetch --all from upstream and also git pull --all But no joy yet

Noticed that when i clone directly from upstream, am able to checkout the branch locally. Which is not the case with cloning my repo. Tentatively on my cloned repo from my fork, have peeked at an upstream branch by checking it out directly using git checkout origin/qa and then working on that branch have create a local tracking branch which is done automatically by using git checkout qa. Could this be an alternative way for me

are you able to see the branch you you want to move to by this command

It clearly shows me the other branches hiding in my repository but they seem to be remote branches. I am not able to checkout any of them locally!

which command are you using to checkout

I want to play around the branch named qa. So am using git ckeckout qa.

what does this git branch return?

try drooping distro and re-clone again dont forget to use git fetch --all

Have attempted it three times. But I think there is some thing obvious am missing not sure what exactly

cc: @herbert24

lets go through the steps together first, am gona fork then clone distro

Remember to clone from your fork

i see the process works fine at my side

  1. git clone https://github.com/HerbertYiga/openmrs-distro-referenceapplication.git (use your forked repo)

  2. git remote add upstream https://github.com/openmrs/openmrs-distro-referenceapplication.git

  3. git pull --rebase upstream master

  4. git fetch --all

  5. git checkout qa

  6. git branch

and am at qa branch now

Have a look at my use case: see log - Pastebin.com

we can connect tomorrow on call and i try to unblock you

1 Like

Attempted it again. Here is the outcome Second Attempt - Pastebin.com

In the meantime have opted and peeked at an upstream branch by checking it out directly using git checkout origin/qa and then working on that branch have created a local tracking branch by using git checkout qa . Hope this can accomplish my goal. cc: @herbert24 @dkayiwa @k.joseph

Make sure you are on qa branch from master it should keep you moving

1 Like