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 trialammarkhan
Front End Web Development Techdegree Student 21,661 PointsWhat 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.
3 Answers
David B Dinkins
71,472 Pointsgit 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 origin
and 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.
ammarkhan
Front End Web Development Techdegree Student 21,661 PointsSorry i didn't get that. Can you give me a example with a url kind of?
ammarkhan
Front End Web Development Techdegree Student 21,661 PointsHow would terminal know, where are my repo hosted e.g treebook or origin?
Matthew Kaplan
9,226 PointsAs 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 git@github.com:peter/first_app.git creates a new remote called origin located at git@github.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 HARPT
19,845 PointsYour remote repository is the version of the repository that is hosted on something like Github.
Luiz Felipe Soares
13,840 PointsLuiz Felipe Soares
13,840 PointsI think you use git remote to set an alias to your repository. Instead of always typing the full address you just use the alias. And then you are able to fetch a pull data just "calling" the alias instead of the full address... like a bookmark for your remote server.
Correct me if I am wrong.
Cheers