Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Introduction to Git GitHub and Other Remote Repositories Pushing Commits to GitHub

Philip Schultz
Philip Schultz
11,343 Points

git remote add - question

I'm a little confused as to what is going when we push up to GitHub. Are we reassigning or creating an new origin? I thought the origin was the medals directory. So when we create this new remote repo, github, by typing in the command "git remote add origin http://github/username/file.git" on the local host are we handing over the crown, so to speak to github as the new origin. If so, does all of the other remote repos know that github is the new 'origin'? would the myclone repo know?

I hope this makes since, because I'm confused.....lol thanks,

thank you for asking this. It was exactly where my confusion lied as well

1 Answer

Bruce Röttgers
Bruce Röttgers
18,211 Points

Yes that pretty much sums it up. Github is the new origin.

If the repo only exists on your local machine, the original repo on your computer is the origin. If the repo is available on Github, etc. (centralised), it's always the hosted service (e.g. Github) which is the origin, because everyone is getting their information from them

Hope this makes sense.