github的使用教程
生活随笔
收集整理的這篇文章主要介紹了
github的使用教程
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.github登錄注冊
https://github.com2.創建一個倉庫
Create a New Repository3.本地安裝git客戶端
http://msysgit.github.com/4.配置git
在本地倉庫中建立文件夾 進入test目錄,右擊鼠標,選擇git bash here 執行git init5.配置權限
為了把本地的倉庫傳到github,還需要配置ssh key。 $ ssh-keygen -t rsa -C "757661238@qq.com" 直接點回車,說明會在默認文件id_rsa上生成ssh key。 打開id_rsa.pub,復制里面的key。 回到github網站,進入Account Settings,左邊選擇SSH Keys,Add SSH Key, title隨便填,粘貼key。 驗證是否成功,在git bash下輸入 $ ssh -T git@github.com 回車就會看到:You’ve successfully authenticated, but GitHub does not provide shell access 。這就表示已成功連上github。6.設置username和email,因為github每次commit都會記錄他們
$ git config --global user.name "your name" #github的用戶名 $ git config --global user.email "757661238@qq.com"7.進入要上傳的倉庫,右鍵git bash,添加遠程地址
$ git remote add origin git@github.com:bingoxubin/test.git 后面的yourName和yourRepo表示你再github的用戶名和剛才新建的倉庫,加完之后進入.git,打開config,這里會多出一個remote “origin”內容,這就是剛才添加的遠程地址,也可以直接修改config來配置遠程地址。 到現在已經將本地的git和GitHub連接起來了。8.先在本地同步一下倉庫的內容,命令如下:
git pull git@github.com:bingoxubin/test.git9.上傳到遠程倉庫
git push git@github.com:bingoxubin/test.git總結
以上是生活随笔為你收集整理的github的使用教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深入理解Spring Boot数据源与连
- 下一篇: 『中级篇』Dockerfile详解(17