# Switching off the main branch

**URL:** <https://forum.dimagi.com/t/switching-off-the-main-branch/365>\
**Category:** Developers\
**Created:** [March 23, 2010, 1:38pm UTC](https://forum.dimagi.com/t/switching-off-the-main-branch/365 "2010-03-23T13:38:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whitney\_Schaefer](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@Whitney\_Schaefer](https://forum.dimagi.com/u/Whitney_Schaefer)\
**Post date:** [March 23, 2010, 1:38pm UTC](https://forum.dimagi.com/t/switching-off-the-main-branch/365/1 "2010-03-23T13:38:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Whitney\_Schaefer](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@Whitney\_Schaefer](https://forum.dimagi.com/u/Whitney_Schaefer)\
**Post date:** [March 23, 2010, 2:03pm UTC](https://forum.dimagi.com/t/switching-off-the-main-branch/365/2 "2010-03-23T14:03:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![czue](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/czue/32/493_2.png) [@czue](https://forum.dimagi.com/u/czue)\
**Post date:** [March 24, 2010, 2:40pm UTC](https://forum.dimagi.com/t/switching-off-the-main-branch/365/3 "2010-03-24T14:40:11Z")

</div>

> 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.

Glad you got this sorted!

-Cory

> **···**
>
> 2010/3/23 Whitney Schaefer :
> 
> > On Mar 23, 9:38 am, Whitney Schaefer [whitney.ty...@gmail.com](mailto:whitney.ty...@gmail.com) 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
> > 
> > To unsubscribe from this group, send email to [commcare-hq-developers+unsubscribegooglegroups.com](http://commcare-hq-developers+unsubscribegooglegroups.com) or reply to this email with the words "REMOVE ME" as the subject.
