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. Please specify which branch you want to merge with. It is tempting to use a more descriptive nickname (such as github), but you might find that following convention is worth it. git pull -set-upstream-to git pull git pull There is no tracking information for the current branch. 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). 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. Cuando necesitamos configurar la rama remota predeterminada como nuestra rama local actual, tenemos que ejecutar el comando git upstream. remote Heads up You can use the -u flag instead of -set-upstream with git push like. Another thing that you may want to do before pushing is to rebase your changes against upstream/master so that your commits are all together. See Ondrej K.s answer for a command sequence, but Ill add here that its not crucial how the remotes come about: you could delete all remotes and re-add them, and the only real cost would be that you typed in a few extra commands. Git clone automatically adds a new remote, so often you do not need to do
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |