上傳本地檔案到github

來源:互聯網
上載者:User

標籤:git add   com   config   origin   keygen   ros   name   關聯   步驟   

  1.用git Bash 命令

  2.綁定使用者

$ git config --global user.name "xiaoyucheng921"$ git config --global user.email "[email protected]"

3.產生ssh key
首先檢查是否已產生密鑰cd ~/.ssh,如果返回的ls有3個檔案,則密鑰已經產生。
如果沒有密鑰,則通過
$ ssh-keygen -t rsa -C "[email protected]"產生
產生過程中一路按3次斷行符號鍵 C:\Users\.ssh
4為github帳號配置ssh key
登入github官網 點擊頭像———>settings--->SSH and GPG keys--->SSH keys--->key 將id_rsa.pub檔案中key粘貼到此,最後Add key產生密鑰
第一次需要以上步驟,以後可直接跳過
5
上傳本地項目到github
1.cd d:XXXX進入到專案檔夾XXXX
2.執行指令:git init 初始化成功後項目裡多了一個隱藏檔案夾.git
3.執行指令:git add .
將所有檔案添加到倉庫
4.執行指令:git commit -m "提交檔案" 雙引號內是提交注釋。
6
關聯github倉庫

2.執行指令:git remote add origin https://github.com/xiaoyucheng921/news.git 這個地址是github建立倉庫時產生的
3.執行指令:git push -u origin master


 

上傳本地檔案到github

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.