如何通过命令将本地项目代码上传到github

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhihaoma/article/details/70739050

1、建立github仓库

在待传项目代码的根目录下打开命令行工具,键入:

git init
2、将项目的所有文件添加到仓库中

git add .
如果只是想 添加指定的文件,那么将.换成该文件名即可。

3、commit

git commit -m "注释部分"
4、打开自己的github,创建Repository:


点击Create repository,获取红色部分的链接:


5、把本地的仓库和github进行关联

https://github.com/marho2016/scikit-learn_example.git
6、上传代码到github远程仓库

git push -u origin master
提示输入github的Username和password,输入即可。

上传成功!



猜你喜欢

转载自blog.csdn.net/zhihaoma/article/details/70739050
今日推荐