您的位置:首页 > 其它

简易将现有项目提交到码云(gitee)

2018-10-11 16:34 585 查看

想了解更多关于码云,请参考码云帮助文档: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分支

日志信息如下:

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 远程仓库地址,即可查看到项目文件。

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: