git上傳本地項目到github或者gitlib(兩個是一樣的)。


第一步:在github上面創建一個repository 

 

 點擊create就好了。然后會出現下面的頁面。

第三步:打開你所在文件夾,或者是新建的文件夾(用來做倉庫的)右鍵會出現下面  選用git Bash Here 命令行執行。

點擊以后出現下面圖片

然后就是使用剛才我們在github上面創建的倉庫 依次執行下面的代碼。。。下面是兩種形式。(空倉庫、項目所在倉庫)

create a new repository on the command line

echo "# project" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin 這里是自己的鏈接
git push -u origin master

 push an existing repository from the command line

git remote add origin 自己創建的repository鏈接
git push -u origin master

 本人用的是第二種比較方便:

遇到問題分享一下:

  remote origin already exists.

 解決方法:

  

先刪除遠程Git倉庫用 $ git remote rm origin

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM