![]() ![]() It is common to use upstream as the nickname for this remote. It makes your setup easier for others to understand and for you to transfer information that you read in documentation, on Stack Overflow, or in blogs.Ī common reason to add a second remote is when you have done a “fork and clone” of a repo and your personal copy (your fork) is set up as the origin remote.Įventually you will want to pull changes from the original repository. It is tempting to use a more descriptive nickname (such as github), but you might find that following convention is worth it. git remote add upstream Ardhi Muzammil git remote add upstream View another examples Add Own solution Log in, to leave a comment 4.75 4 Wolpertinger 70 points git remote add upstream :some-gatekeeper-maintainer/some-project.git Thank you 4 4.75 (4 Votes) 0 3. The purpose of setting upstream is to make git push and git pull easier. The local branch is called the tracking branch, the branch it tracks - the remote branch is called the upstream branch. The Git User’s Manual has a more in-depth introduction. See gittutorial 7 to get started, then see giteveryday 7 for a useful minimum set of commands. Sidebar on nicknames: there is a strong convention to use origin as the nickname of your main remote.Īt this point, it is common for the main remote of a repo to be hosted on GitHub (or GitLab or Bitbucket). Git calls set upstream to establish this kind of relationship. Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. Note: when you add a remote you give it a nickname (here happygit), which you can use in git commands in place of the entire URL. ![]() Use git remote add to add a new remote: git remote add happygit However, after the initial clone, it is often useful to add additional remotes. Git clone automatically adds a new remote, so often you do not need to do ![]()
0 Comments
Leave a Reply. |