使用gitee(码云)创建项目

2018/08/12 17:20
阅读数 1.8K

注册登录

https://gitee.com/ 也可以直接用oschina的帐号。

创建项目

点击“+”号,创建项目。

执行git命令

本机创建一个你的这个项目目录,init后不要忘了把代码拷贝进去再add。

git init
git remote add origin https://gitee.com/danni3/spring-retry-demo.git
git add .
git commit -m "create project"
git push  --set-upstream origin master

完整命令:

Administrator@FREESKYC-92DB80 MINGW32 /e/git
$ mkdir spring-retry-demo

Administrator@FREESKYC-92DB80 MINGW32 /e/git
$ cd spring-retry-demo/

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo
$ ls

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo
$ git init
Initialized empty Git repository in E:/git/spring-retry-demo/.git/

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git remote add origin https://gitee.com/danni3/spring-retry-demo.git

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git pull origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://gitee.com/danni3/spring-retry-demo
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git add .

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git commit -m "create project"
[master b5abb8a] create project
 5 files changed, 128 insertions(+)
 create mode 100644 .classpath
 create mode 100644 .project
 create mode 100644 pom.xml
 create mode 100644 src/com/danni/Application.java
 create mode 100644 src/com/danni/RemoteService.java

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git push --set-upstream origin master

这里会弹出框,输入gitee的用户名(danni3),密码即可。

Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (10/10), 2.16 KiB | 0 bytes/s, done.
Total 10 (delta 0), reused 0 (delta 0)
remote: Powered by Gitee.com
To https://gitee.com/danni3/spring-retry-demo.git
   9c5fb54..b5abb8a  master -> master
Branch master set up to track remote branch master from origin.

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)

密码错误

如果用户名或者密码错误:

remote: Incorrect username or password ( access token )
fatal: Authentication failed for 'https://gitee.com/danni3/spring-retry-demo.git/'

注意

gitee上显示的提交者不是你的gitee用户名,而是你本机的git的user.name,这个看过《git权威指南》的都清楚,不再赘述。

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git config --global user.name danni

Administrator@FREESKYC-92DB80 MINGW32 /e/git/spring-retry-demo (master)
$ git config user.name
danni

参考

https://blog.csdn.net/gxx_csdn/article/details/78906910

展开阅读全文
打赏
0
1 收藏
分享
加载中
更多评论
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部