学习机器学习,看着《机器学习实战》,从其官网下载了源代码,可能是因为懒吧,不想盯着书本敲着里面的代码,下了之后想到以后修改啥的,就想放在github上托管吧,之前都是fork别人的仓库,没有亲自创建过,那就创一个吧。
在your profile的Repositories,点击创建,如下图:
然后会出现下图:
把对应的填写完,再勾上initialize this repository with a README,后面你就不用再添加了。
接下来如下图:
这样你就创建好了一个仓库,接下来的事情是你怎么把本地的git仓库和这个仓库相连接,在本地git仓库下打开git bash,执行:
git remote add origin [email protected]:lvwuyunlifan/test.git # 这是绑定本地和github上的远程仓库
如果出现错误提醒:
fatal: remote origin already exists.
则先执行:git remote rm origin,再执行:
git remote add origin [email protected]:lvwuyunlifan/test.git
刚开始仓库什么都没有,执行:
git push -u origin master
如果出现错误提示:hint: See the 'Note about fast-forwards' in 'git push --help' for details.说明本地仓库和远程仓库版本不一致,则先:
git pull 仓库地址
如果报错:fatal: refusing to merge unrelated histories
那说明有冲突,则执行:
git pull origin master --allow-unrelated-histories
git status # 找出红色标注的进行解决冲突,解决完了之后:
git add .
git commit -m 'some thing'
git push origin master
进行远程推送。至此已完成。
欢迎star我的《机器学习实战》仓库
地址:[email protected]:lvwuyunlifan/Mechine-Learn-in-Action.git
[email protected]:lvwuyunlifan/Mechine-Learn-in-Action.git
[email protected]:lvwuyunlifan/Mechine-Learn-in-Action.git
书本的作者是有源代码的项目,只是我没看到,创建了仓库之后才发现的,
地址:[email protected]:pbharrin/machinelearninginaction.git
[email protected]:lvwuyunlifan/test.git
[email protected]:lvwuyunlifan/test.git