https://help.github.com/articles/generating-ssh-keys
2, test connection with github
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.0.52.28' to the list of known hosts.
Hi gds! You've successfully authenticated, but GitHub does not provide shell access.
3, Add your project to Github
A, create a repo in github
B, in your local box,
DO:
$ git config --global user.name "Smith Chris" $ git config --global user.email schris@example.com
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/gdsdong/csstemplate-acupuncture.git
git push -u origin master
 
git remote add origin git@github.com:gdsdong/csstemplate-decoration.git
git push -u origin master 
 
Error:
$ git push -u origin master
error: The requested URL returned error: 403 while accessing 
https://github.com/gdsdong/csstemplate-acupuncture.git/info/refs
Need to update local git config
- edit 
.git/configfile under your repo directory - find 
url=entry under section[remote "origin"] - change it from 
url=https://github.com/xxxx/lxxx.gittourl=ssh://git@github.com/xxxx/lxxx.git. that is. - Save 
configfile and quit. now you could usegit push origin masterto sync your repo on GitHub 
No comments:
Post a Comment