1.建立項目,進入項目文件夾
2.初始化ssh key 參見官網指南.(本機生成一對key,public key傳到官網sshkey下面)
https://help.github.com/articles/generating-ssh-keys/
3.初始化用戶名,郵箱
$ git config --global user.name "defnngj"http://給自己起個用戶名
$ git config --global user.email "[email protected]"http://填寫自己的郵箱
4.git init
5.git add .
6.git commit -m "message for this commit"
7.touch README.md
8.git add README.md
9.git status
10.去github網站建立一個repo 如"ts.git"
11.git remote add origin [email protected]:wuzhuzhu/ts.git
如果遇到了fatal: remote origin already exists.輸入:
git remote rm origin
12.git remote add origin [email protected]:wuzhuzhu/ts.git
13.git push -u origin master
Counting objects: 19, done.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (19/19), 4.54 KiB, done.
Total 19 (delta 1), reused 0 (delta 0)
To [email protected]:wuzhuzhu/ts.git
[new branch] master -> master
Branch master set up to track remote branch master from origin.
14.拉取git文檔:
在遠程主機上:
git remote add origin [email protected]:wuzhuzhu/ts.git
git pull origin master
遇見的問題:
windows 客戶端是渣...還是要用git shell 要不連創建repo都總是網絡報錯 遠程服務器要搞定ssh key... git
remote add origin [email protected]:wuzhuzhu/ts.git
是指制定origin到這個git網址,不要重復綁定.
以上就是個人簡化版的github配置了,拋磚引玉,給小伙伴們參考下
新聞熱點
疑難解答