github上提供的方法

如何把项目上传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

[email protected] MINGW64 /d/code/springcloud
$ git init
Initialized empty Git repository in D:/code/springcloud/.git/

[email protected] MINGW64 /d/code/springcloud (master)
$ git commit -m “first commit”
On branch master
nothing to commit, working tree clean

[email protected] MINGW64 /d/code/springcloud (master)
$ git remote add origin https://github.com/jinlingjike/springcloud.git

[email protected] 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’.

[email protected] 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.
如何把项目上传github
如何把项目上传github

相关文章: