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 Pushing and Pulling

Why do we type "git push origin new_feature" if it already assumes origin when we don't type it.

The instructor says that if we don't provide a remote repo name, git automatically assumes it to be "origin" but when he doesn't provide it, git shows an error message. What is the reason behind?

1 Answer

If you run git push and don't provide a remote, git will assume that your remote is origin. In the case you want to push a branch to the remote, when you run git push origin new_feature, if you don't provide the name of the remote, git will assume that the name of the remote is new_feature