- Github is a hosting platform for git repos. You can put your own repo on Github and access them from anywhere and share them with people around the world.
- Git Origin: When we clone a Github repo, the default remote name setup for us is called origin.
- git remote and git remote -v : It consists of an URL and a Label.
- git remote add <name> <url> : adds a new remote
- git push <remote> <branch> : push the work onto github. (git push origin master)
Push In Detail:
- git push <remote> <local branch> : <remote-branch>
- Eg: git push origin cats:master
- git push -u origin master : When you do this you are saying git to push the master branch to origin and want to remember that. I want git to recall in the future that my master branch on my computer is connected to the origin.
1. Connnecting an Existing Repo:
- Create a new repo on github
- Connect your local repo (add a remote : destination url)
- push up you changes to Github
2. Start from scratch:
- If you have not begun work on your local repo, you can
- create a brand new repo on github
- clone it down to your machine
- Do some work locally
- Push up your changes to Github