Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Working With Remote Repositories GitHub

For git push -u origin master, does github become the master branch?

Hey everyone, just trying to wrap my head around this. When you push it to github, does github become the master branch?

Thanks!

2 Answers

Hi Alex,

Github does and does not become your master branch. You basically have two master branches; one on the git repo on your local machine and one master branch on the repo being hosted by Github. They can have the exact same content, but they also could also be any number of changes or commits further ahead or behind each other.

Hey Alex,

It pushes your work in your local master branch to your Github repo once you have set up your origin when you initially set up your repo on GH. The "-u" flag tracks your changes upstream (in the master branch of your GH repo).

I hope this helps!