码云上使用git
一.登陆码云,注册账号二. 设置SSH-KEY生成公匙git命令: ssh-keygen -t rsa -C “注册码云账号时的邮箱号”cat ~/.ssh/id_rsa.pub复制git输出的内容粘贴到码云的SSH keys settings (具体操作如下)设置公匙登陆码云,点击头像—settings—SSH keys se
一. 登陆码云,注册账号
二. 设置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.
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)