Git: Linking a remote branch



Hi there, literally just started using c9. I have linked my Github account and can see my master branch but I would like to work on a different branch. I can’t seem to work out how to to fetch / checkout my remote branch. I ended up creating a new one of the same name locally but I’m still not able to link to it using upstream! Any help would be appreciated.



When you are working locally, you can create and switch to a new branch using the git checkout -b <new_branch_name>.

You can push this branch to origin or other remote you own using git push origin <new_branch_name>. Since this is a new branch, it will be created first in your origin repository and then pushed.

Also I would recommend taking a look at Git Immersion, a great read.

Hope this helps. If you have more questions, let us know.


Hi - I am having a similar problem.

My GitHub repo contains two branches - master and a feature branch.

However, my Cloud9 workspace seems to only know about the master branch.

Is it possible to reconfigure my workspace to pull the feature branch from GitHub instead of master?
If so, that is what I would like to do.


I have the same issue. My origin has two branches, master and testing, but c9 only seemed to be aware of master. I created my own testing branch on the c9 side, but any change I make to my code in c9 seems to affect all branches because switching between branches via checkout doesn’t reflect any changes.