1. 程式人生 > >簡易將現有專案提交到碼雲(gitee)

簡易將現有專案提交到碼雲(gitee)

簡易將現有專案提交到碼雲(gitee)


想了解更多關於碼雲,請參考碼雲幫助文件:http://git.mydoc.io/

一、建立碼雲賬號 以及git安裝

1.碼雲賬號讀者請自行建立,參考教程:http://git.mydoc.io/?t=179267
2.git軟體讀者請自行安裝,參考教程:https://jingyan.baidu.com/article/9f7e7ec0b17cac6f2815548d.html

二、將本地專案上傳到gitee

1.在碼雲上建立專案,進行相關配置(讀者請根據自身需要),如圖:


點選 “建立”,完成後如圖會有新建專案對應的教程,(請記住所提供的遠端專案地址,例如:

https://gitee.com/belonghuang/stooges.git),:

2.在對應現有專案,滑鼠右擊,出現如圖:


選擇“Git Bash Here”。或者讀者可以用命令提示符,進入到該目錄。

3.執行對應命令將已有專案專案加入到gitee,如下:

git init                                                         #初始化
git add .                                                        #將當前目錄加入到git
git commit -m "first commit(提交的描述資訊)"                     #git提交到本地版本庫
git remote add origin https://gitee.com/belonghuang/stooges.git  #git本地庫連線遠端版本庫,這一步會有對應輸入賬號和密碼的操作
git push -u origin master   #將檔案上傳到遠端版本庫master分支

日誌資訊如下:

[email protected] MINGW64 /d/learnplace/stooges
$ git init
Initialized empty Git repository in D:/learnplace/stooges/.git/

[email protected] MINGW64 /d/learnplace/stooges (master)
$ git add .
warning: LF will be replaced by CRLF in .idea/compiler.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/flexCompiler.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/inspectionProfiles/Project_Default.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/modules.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/uiDesigner.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/WEB-INF/.gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/WEB-INF/lib/.sigar_shellrc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/WEB-INF/logs/daily.logdaily.2018-05-09.log.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/WEB-INF/logs/daily.logdaily.2018-05-10.log.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/attachfiles/importWord/20180505/297ecf12632eccc901632ecff3d90005.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in WebRoot/plug-in/Jcrop-0.9.12/css/jquery.Jcrop.css.
The file will have its original line endings in your working directory.
..........
[email protected]
MINGW64 /d/learnplace/stooges (master) $ git commit -m "first commit" [master (root-commit) cfcb94f] first commit 4091 files changed, 639384 insertions(+) create mode 100644 .classpath create mode 100644 .idea/artifacts/stooges_war_exploded.xml create mode 100644 .idea/azureSettings.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/flexCompiler.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/libraries/docs.xml create mode 100644 .idea/libraries/lib.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/workspace.xml create mode 100644 .project create mode 100644 .settings/.jsdtscope create mode 100644 .settings/com.genuitec.eclipse.migration.prefs create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.jdt.ui.prefs create mode 100644 .settings/org.eclipse.wst.common.component create mode 100644 .settings/org.eclipse.wst.common.project.facet.core.prefs.xm l create mode 100644 .settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name ........ [email protected] MINGW64 /d/learnplace/stooges (master) $ git remote add origin https://gitee.com/belonghuang/stooges.git [email protected] MINGW64 /d/learnplace/stooges (master) $ git push -u origin master Username for 'https://gitee.com':XXXXXXXXXXX Counting objects: 4456, done. Delta compression using up to 4 threads. Compressing objects: 100% (4332/4332), done. Writing objects: 1% (62/4456), 11.02 MiB | 1.76 MiB/s

三、驗證是否提交到遠端倉庫

訪問 https://gitee.com/belonghuang/stooges 遠端倉庫地址,即可檢視到專案檔案。