github上傳本地代碼

來源:互聯網
上載者:User

標籤:開啟   nbsp   git bash   comm   push   bash   .exe   exe   分支   

在已經有了GitHub帳號並且下載了git.exe的前提下

1. 找到代碼所在目錄,開啟git bash,cd到項目所在目錄下,輸入 git init 命令,可以看見檔案中產生 .git檔案夾,這個是用作管理git倉庫。

2. 輸入 git add . 添加項目中所有的檔案到倉庫,也可以將 . 換成檔案名稱,用來只添加一個特定檔案

3. 輸入 git commit 命令,提交代碼到本地倉庫

4. 將本地倉庫與GitHub關聯,需要我們在GitHub上new的Reporsitory的url,如[email protected]:Yakhou/SpringMVC.git

  輸入命令:git remote add origin [email protected]:Yakhou/SpringMVC.git

5. 如果在GitHub上初始建立倉庫的時候有添加README檔案,則需要將其合并(也可以重新建立分支 git branch)

  輸入命令:git pull origin master

6. 上傳本地代碼到GitHub: 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.