I've been working on the main branch of commcarehq and now I want to
push my changes to the domains branch. I believe that I need to change
branches in order to do this. I'm new to git, but after doing some
searching I believe that the command to use is 'git checkout -m
[branch]'. I tried this using 'git checkout -m origin/domains' and now
when I do a 'git branch -a' the indicator for current branch is next
to '(no branch)'. Here's everything I get from branch:
(no branch)
remotes/origin/HEAD -> origin/master
remotes/origin/domains
remotes/origin/intel
remotes/origin/master
Can anyone tell me if I'm just using the wrong command? Or if I need
to use something other than 'origin/domains' as my indication for the
domains branch?
I haven't been able to switch back to HEAD either.
An update:
It looks like the problem was that I was trying to switch to a non-
local branch. So I'm now back on a local branch (which I hope is
pointing to head). I think I need to make a local branch that points
to the remote domains branch and then checkout to there. Sound right?
So I need to do a 'git branch [localbranchname] origin/domains' and
then 'git checkout [localbranchname]'?
···
On Mar 23, 9:38 am, Whitney Schaefer wrote:
> I've been working on the main branch of commcarehq and now I want to
> push my changes to the domains branch. I believe that I need to change
> branches in order to do this. I'm new to git, but after doing some
> searching I believe that the command to use is 'git checkout -m
> [branch]'. I tried this using 'git checkout -m origin/domains' and now
> when I do a 'git branch -a' the indicator for current branch is next
> to '(no branch)'. Here's everything I get from branch:
> * (no branch)
> remotes/origin/HEAD -> origin/master
> remotes/origin/domains
> remotes/origin/intel
> remotes/origin/master
>
> Can anyone tell me if I'm just using the wrong command? Or if I need
> to use something other than 'origin/domains' as my indication for the
> domains branch?
>
> I haven't been able to switch back to HEAD either.
>
> Thanks,
> Whitney
An update:
It looks like the problem was that I was trying to switch to a non-
local branch. So I'm now back on a local branch (which I hope is
pointing to head). I think I need to make a local branch that points
to the remote domains branch and then checkout to there. Sound right?
So I need to do a 'git branch [localbranchname] origin/domains' and
then 'git checkout [localbranchname]'?
Right. You also might need a --track flag before the origin/domains bit.
I've been working on the main branch of commcarehq and now I want to
push my changes to the domains branch. I believe that I need to change
branches in order to do this. I'm new to git, but after doing some
searching I believe that the command to use is 'git checkout -m
[branch]'. I tried this using 'git checkout -m origin/domains' and now
when I do a 'git branch -a' the indicator for current branch is next
to '(no branch)'. Here's everything I get from branch:
(no branch)
remotes/origin/HEAD -> origin/master
remotes/origin/domains
remotes/origin/intel
remotes/origin/master
Can anyone tell me if I'm just using the wrong command? Or if I need
to use something other than 'origin/domains' as my indication for the
domains branch?
I haven't been able to switch back to HEAD either.