2019独角兽企业重金招聘Python工程师标准>>> 
1、首先在GitHub创建一个新的仓库,为了避免出错,不要用README license,gitignore 初始化仓库。这些可以稍后再添加。

2、打开本地电脑安装的Git Bash

3、将当前工作目录指向本地项目所在目录。

4、初始化本地目录,作为Git仓库
$ git init
5、添加文件到新的本地仓库。这是第一次提交阶段
$ git add .
# Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
6、提交文件
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
7、复制GitHub仓库快速设置页面的远程仓库URL

8、在命令提示符中,添加远程仓库URL
$ git remote add origin remote repository URL
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
9、向GitHub推送本地仓库有改动的文件
$ git push origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin
转载于:https://my.oschina.net/benz001/blog/3059498
最后
以上就是老迟到小土豆最近收集整理的关于用命令行向GitHub添加Project的全部内容,更多相关用命令行向GitHub添加Project内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复