码云上使用git

一. 登陆码云,注册账号

二. 设置SSH-KEY

生成公匙

git命令: ssh-keygen -t rsa -C “注册码云账号时的邮箱号”
cat ~/.ssh/id_rsa.pub
复制git输出的内容粘贴到码云的SSH keys settings (具体操作如下)

设置公匙

登陆码云,点击头像—settings—SSH keys settings — ssh key名称随意写,下面的空格粘贴上面复制的id_rsa.pub的内容,点击确定即可

三. 在码云上创建项目

四. 把本地的项目上传到码云上命令

设置name和email
git config –global user.name “Your Name”
git config –global user.email “Your Email
这里写图片描述

git clone git@gitee.com.xxxxxx/mongodb-test.git
cd mongodb-test/ 进入mongodb-test文件夹(含有.git)
git status 列出分支
git add .
git commit -m ‘first commit’ 提交到本地,将暂存的文件提交到git仓库
git push -u origin master 向远程分支推送数据
此时项目就会上传到码云上了

git命令:

baiyu@FANJC MINGW32 /e/myCode
$ git clone git@gitee.com:xxxxxx/mongodb-test.git
Cloning into 'mongodb-test'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.

baiyu@FANJC MINGW32 /e/myCode
$ cd mongodb-test/

baiyu@FANJC MINGW32 /e/myCode/mongodb-test (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        .mvn/
        mvnw
        mvnw.cmd
        pom.xml
        src/

nothing added to commit but untracked files present (use "git add" to track)

baiyu@FANJC MINGW32 /e/myCode/mongodb-test (master)
$ git add .
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .mvn/wrapper/maven-wrapper.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in mvnw.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in mvnw.cmd.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in pom.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/java/com/yubai/mongodbtest/MongodbTestApplication.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/test/java/com/yubai/mongodbtest/MongodbTestApplicationTests.java.
The file will have its original line endings in your working directory.

baiyu@FANJC MINGW32 /e/myCode/mongodb-test (master)
$ git commit -m 'first commit'
[master 6642dad] first commit
 10 files changed, 744 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .mvn/wrapper/maven-wrapper.jar
 create mode 100644 .mvn/wrapper/maven-wrapper.properties
 create mode 100644 mvnw
 create mode 100644 mvnw.cmd
 create mode 100644 pom.xml
 create mode 100644 src/main/java/com/yubai/mongodbtest/MongoDBTest.java
 create mode 100644 src/main/java/com/yubai/mongodbtest/MongodbTestApplication.java
 create mode 100644 src/main/resources/application.properties
 create mode 100644 src/test/java/com/yubai/mongodbtest/MongodbTestApplicationTests.java

baiyu@FANJC MINGW32 /e/myCode/mongodb-test (master)
$ git push -u origin master
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (26/26), 49.18 KiB | 2.73 MiB/s, done.
Total 26 (delta 0), reused 0 (delta 0)
To gitee.com:xxxxxxx/mongodb-test.git
   e3313c1..6642dad  master -> master
Branch master set up to track remote branch master from origin.

参考:[使用码云] (https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00150154460073692d151e784de4d718c67ce836f72c7c4000

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值