本地專案上傳到碼雲上(圖解)
阿新 • • 發佈:2018-12-10
將本地專案上傳到碼雲上(圖解)
- 首先在碼雲上建一個專案
2在本地建立一個資料夾 ,開啟資料夾 右鍵 git Bash here
3.在git視窗上輸入git init 這時你的本地資料夾就會出現一個.git 的資料夾 如果沒有 點選資料夾->組織-》資料夾和搜尋框 ->檢視->顯示隱藏
4 複製你剛才建立的碼雲上面的路徑 (http)
5 git remote add origin http://git.com/xxxx(你剛才建立的碼雲上面的路徑)
解釋:新增新的遠端倉庫關聯 git remote add
6.git pull origin master
解釋:將碼雲上面的倉庫pull到本地資料夾
7.將要上傳的檔案新增到剛剛建立的本地資料夾裡面
8.git add . 或者 git add +檔名 將檔案儲存到緩衝區
9.git commit -m ‘描述’
10 git push origin master 將本地倉庫推送到遠端倉庫
11.開啟你的碼雲 重新整理就可以了
注意:在走到git push origin master這一步的時候 出現了
fatal: ‘orgin’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解決方法(網上找的):
重新輸入一次 git remote add origin 路徑
git push -u origin master