


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.

git git remote add origin git hub.com/yourName/repositoryname. git remote add origin git git hub.com:yourName/repositoryname. It is tempting to use a more descriptive nickname (such as github), but you might find that following convention is worth it. cc./cache.aspxd99525174309&wE-Ct5y2ut2fY-2biYnuGm0mAJozTWF7e Git 1. 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). 5) git commit -m 'first commit' If you are asked to enter your identity then use these commands: )git config -global user.email 'enter your Github email id' )git config -global user.name 'enter a Github user name' then again type step 5. 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. What are remote repositories Forks and pull requests Set up your GitHub account Forking and cloning a GitHub repository Adding a remote repositories. You can use the file name instead of the dot. 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
