从本地git上传至github上的命令

github创建项目的时候官网可见

第一种命令行:上传一个新的项目的命令(按顺序执行)

…or create a new repository on the command line

echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:mushangyuyu/test.git
git push -u origin master

第二种命令行:上传已经存在于github上的项目

…or push an existing repository from the command line

git remote add origin [email protected]:mushangyuyu/test.git
git push -u origin master

第三种命令行:从另外一个项目导入代码,可以直接上传

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

猜你喜欢

转载自blog.csdn.net/qq_41586280/article/details/87914573