github上傳檔案

來源:互聯網
上載者:User

標籤:

 之前用過github管理自己的代碼,但是一直記不住語句,今天又用到github,還是記錄下來吧!

 1.初次上傳自己的代碼

     在github上建立自己的庫,然後在你的代碼的目錄下執行:

        git init
  touch README.md
  git add README.md 

  git commit -m ‘first_commit‘      執行這句話的時候有時候會出錯

       當出現這個錯誤的時候,根據提示執行: git config --global user.email "[email protected]"  你的git賬戶的郵箱
                                                                                git config --global user.name "Your Name"                 你git賬戶的使用者名稱

  git remote add origin https://github.com/nicky-ji/Turbo.git       
  git push origin master

      

2. 更新自己的程式碼程式庫

     此是用於更新程式碼程式庫的方法

        git add .    (注意後面有個點號.)
  git commit -m ‘first_commit‘
  git remote add origin https://github.com/nicky-ji/Turbo.git        

        執行的時候可能會出現以下的出現,執行語句git remote rm origin

        
     git push origin master   輸入使用者名稱和密碼就ok啦!

     


        ps:

        其實我第一次接觸github的時候,用上面的第一個辦法沒有成功。而是先將空的程式碼程式庫clone下來的,

        先執行git clone https://github.com/nicky-ji/Turbo.git     再執行2的語句。嘿嘿,也是一個辦法哇


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.