After using git to locally track a project, how can I add it to GitHub?
1.Create a README.md
in your local repo (for GitHub -*optional
)
2.git remote add origin
(You can verify you have origin
by entering git remote -v
. You could see
as the origin
).
3.Make a commit by git commit -a -m ""
(Important! Only committed files will be pushed to Github)
4.Now push to GitHub by git push -u origin master
(If you pushing the master branch).
You will be needing passwords every time you push (If you cloned using https:
).For get rid of that ;
In Terminal, enter the following:
git config --global credential.helper cache
# Set git to use the credential memory cache
To change the default password cache timeout, enter the following:
git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)