想了解更多關于碼云,請參考碼云幫助文檔:http://git.mydoc.io/
一、創(chuàng)建碼云賬號 以及git安裝
1.碼云賬號讀者請自行創(chuàng)建,參考教程:http://git.mydoc.io/?t=179267
2.git軟件讀者請自行安裝,參考教程:https://jingyan.baidu.com/article/9f7e7ec0b17cac6f2815548d.html
二、將本地項目上傳到gitee
1.在碼云上創(chuàng)建項目,進行相關配置(讀者請根據(jù)自身需要),如圖:

image.png
點擊 “創(chuàng)建”,完成后如圖會有新建項目對應的教程,(請記住所提供的遠程項目地址,例如:https://gitee.com/belonghuang/stooges.git),:

image.png
2.在對應現(xiàn)有項目,鼠標右擊,出現(xiàn)如圖:
選擇“Git Bash Here”?;蛘咦x者可以用命令提示符,進入到該目錄。

image.png
3.執(zhí)行對應命令將已有項目項目加入到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分支
日志信息如下:
WU@WU MINGW64 /d/learnplace/stooges
$ git init
Initialized empty Git repository in D:/learnplace/stooges/.git/
WU@WU 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.
..........
WU@WU 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
........
WU@WU MINGW64 /d/learnplace/stooges (master)
$ git remote add origin https://gitee.com/belonghuang/stooges.git
WU@WU 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 遠程倉庫地址,即可查看到項目文件。