把本地git項目上傳到coding

很簡單,熟悉之後一、2分鐘就搞定了。html

1. 建立遠程項目路徑git

1.1填入項目名稱,github

1.2選擇導入倉庫,項目地址不用寫;apache

以下圖所示:post

2. 在本地git項目中添加遠程倉庫,上傳spa

2.1 添加遠程倉庫,.net

git remote add <自定義remoteName> https://coding.net/yourusername/projectname.gitcode

2.2 push本地文件htm

git push --set-upstream <自定義remoteName> masterblog

搞定。

 

另外

若是你的本地項目未曾用git初始化,也不曾提交過修改,就會爆出如下錯誤:

error: src refspec master does not match any.

這時,你須要先進行初始化:git init

將改動添加到暫存區:git add . 

而後提交到本地倉庫: git commit -m "your comment"

這樣就能夠push了。

 

git相關命令:

查看遠程倉庫配置:git remote -v

刪除遠程倉庫配置:git remote rm <remoteName>

……

 

refs:

Git查看、刪除、重命名遠程分支和tag

Coding 初級教程(二)——上傳已有項目

github上傳時出現error: src refspec master does not match any解決辦法

相關文章
相關標籤/搜索