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!
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
What is use of git remote?
Hi, Help me understand the use of git remote. I tried playing video twice but was unable to understand. Thanks.
git remote lists your git repository's alias (or aliases). So, for example, if you're trying to push to a git remote repository, then you'll have to use a git command like
git push origin master or
git push treebook in your terminal. In those examples, the words
treebook would be the aliases for their respective projects' repositories. Running
git remote in your terminal will tell you the aliases that you can use for your project's repository.
Matthew Kaplan9,226 Points
As you probably know, git is a distributed version control system. Most operations are done locally. To communicate with the outside world, git uses what are called remotes. These are repositories other than the one on your local disk which you can push your changes into (so that other people can see them) or pull from (so that you can get others changes). The command git remote add origin firstname.lastname@example.org:peter/first_app.git creates a new remote called origin located at email@example.com:peter/first_app.git. Once you do this, in your push commands, you can push to origin instead of typing out the whole URL.
Aaron HARPT19,845 Points
Your remote repository is the version of the repository that is hosted on something like Github.