github远程仓库关联本地仓库简单使用

https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/廖雪峰的github学习官网。

准备工作:一个github账号以及下载好git。

1.在github上创建一个仓库。

2.在本地你想要上传的文件根目录,鼠标右击,打开git bash。

3.依次输入

git init

git add . 将目录下所有的文件全部添加至缓存区,可以选择添加git add 文件名(可以先用git status查看)

git commit -m "add file" (双引号里是注释,解释说明)   提交到分支。

git remote add origin [email protected]:账号名/仓库名.git   关联远程仓库

git push -u origin master 上传

 

PS:可能遇到的问题。。。

一个警告,Permanently added the RSA host key for IP address '192.30.252.128' to the list of known host.类似的

https://blog.csdn.net/hunhun1122/article/details/79752125

一个错误,failed to push some refs to '[email protected]:Monarch510/HardWayToLearnPython.类似的

https://blog.csdn.net/u012685794/article/details/51925889

一个fatal: refusing to merge unrelated histories

https://blog.csdn.net/m0_37402140/article/details/72801372

实在解决不了就删库,重建一个完全空白的库。。。

你可能感兴趣的:(github)