初學者利用git 上傳代碼到Coding的簡單操作步驟

來源:互聯網
上載者:User

標籤:官方網站   net   gui   blog   htm   blank   需要   sharp   ash   

初學者利用git 上傳代碼到Coding的簡單操作步驟

 

1.首先登陸coding網站註冊帳號https://coding.net/

(註冊完後需登陸郵箱啟用郵件)

2.登陸剛註冊的coding帳號 ,添加項目

添加項目—〉輸入項目名稱—〉輸入對項目的簡單描述---〉選擇"公開"—〉建立項目

 

 

 



到此為止,後面需要將本次實驗內容push到該項目chap1下。

此處,需要記錄http://git.coding.net/gdcs16_000/chap1.git   (gdcs16_000為你的註冊名,chap1為建立的項目名)

也可以通過coding網站,選中你的項目—〉代碼,可以找到

 


3.安裝git 用戶端

先安裝Git軟體:Git for Windows下載。

安裝過程中的詳細說明可參考

http://blog.csdn.net/vipzjyno1/article/details/22098621

4.建立本地git 倉庫

在本地磁碟建立一個檔案夾,用來存放需要push到coding上的檔案。開啟此檔案夾,單擊右鍵—〉 git bash here

 

輸入

1 git  init

  

(此步操作完成後,會在此檔案夾下產生一個隱藏的.git尾碼檔案)

 

5.添加、提交檔案到本地倉庫

在剛才建立的test檔案夾中建立了3個檔案,將這些檔案添加並提交到本地倉庫

 

 

 

用到的命令:

123 git add . 或者 git add <filename> git commit –m "項目描述"

  

6.將本地檔案推送到coding伺服器
123 git remote add origin https:// git.coding.net/使用者名稱/項目名.git git push origin master

成功上傳檔案後的

7.Push 過程中遇到的問題及處理方法

(1) 如果push時遇到無許可權,沒有提示輸入使用者名稱和密碼直接403的問題

處理方法:直接修改.git/config檔案中url:

     https://coding使用者名稱:密碼@git.coding.net/使用者名稱/項目名.git

或者通過命令:

     git remote add origin https://coding使用者名稱:密碼@git.coding.net/使用者名稱/項目名.git

(2)如果出現(non-fast-forward)錯誤

可以直接用-f(強制推送)

git push –f origin master

總結一下用到的命令,主要有

12345 git initgit addgit commitgit remote add origin https://git.coding.net/使用者名稱/項目名.gitgit push origin master
8.關於git的更多詳細說明請參考下列文獻

[1] Coding網站help中的git代碼託管

https://coding.net/help/faq/git/git.html#git--git--codingnet

[2] git教程(廖雪峰的官方網站

http://www.liaoxuefeng.com/

[3] 比較詳細的git原理及使用

https://git-scm.com/book/zh/v2

[4] git 的簡易指南

http://www.bootcss.com/p/git-guide/

初學者利用git 上傳代碼到Coding的簡單操作步驟

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.