github上提供的方法

在这里插入图片描述

1、create a new repository on the command line

echo “# mycode” >> README.md
git init
git add README.md
git commit -m “first commit”
git remote add origin https://github.com/jinlingjike/mycode.git
git push -u origin master

Gapon@DESKTOP-U19F2SJ MINGW64 /d/code/springcloud
$ git init
Initialized empty Git repository in D:/code/springcloud/.git/

Gapon@DESKTOP-U19F2SJ MINGW64 /d/code/springcloud (master)
$ git commit -m “first commit”
On branch master
nothing to commit, working tree clean

Gapon@DESKTOP-U19F2SJ MINGW64 /d/code/springcloud (master)
$ git remote add origin https://github.com/jinlingjike/springcloud.git

Gapon@DESKTOP-U19F2SJ MINGW64 /d/code/springcloud (master)
$ git push -u origin master
Username for ‘https://github.com’: jinlingjike
Enumerating objects: 124, done.
Counting objects: 100% (124/124), done.
Delta compression using up to 4 threads
Compressing objects: 100% (72/72), done.
Writing objects: 100% (124/124), 61.45 KiB | 953.00 KiB/s, done.
Total 124 (delta 22), reused 0 (delta 0)
remote: Resolving deltas: 100% (22/22), done.
To https://github.com/jinlingjike/springcloud.git

  • [new branch] master -> master
    Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.

Gapon@DESKTOP-U19F2SJ MINGW64 /d/code/springcloud (master)
$

2、push an existing repository from the command line

git remote add origin https://github.com/jinlingjike/mycode.git
git push -u origin master

3、import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
在这里插入图片描述
在这里插入图片描述

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐