网站开发流程人物,职业培训学校加盟合作,百度下载免费安装到桌面,江苏商城网站建设之前文章写过廖雪峰老师关于git教程的帖子#xff0c;现在终于有时间实践了#xff01;我这段时间在学微信小程序版的贪吃蛇#xff0c;
想着先把写好的文件上传试试#xff0c;于是乎#xff0c;便有了如下……
大家要是不想听废话可以拉到最后去……
1、我先在github…之前文章写过廖雪峰老师关于git教程的帖子现在终于有时间实践了我这段时间在学微信小程序版的贪吃蛇
想着先把写好的文件上传试试于是乎便有了如下……
大家要是不想听废话可以拉到最后去……
1、我先在github上新建了一个仓库记录好GitHub给出的地址
2、在要上传的文件夹下
Git bash——git init——》git add . (偷懒了把全部文件一次性上传……——》git commit -m ***
3、把本地仓库与远程仓库关联
$ git remote add origin gitgithub.com:MeMeLeevv/SnakeGame.git 把本地库的所有内容推送到远程库上
$ git push -u origin master
是不是绝对嗯完美了
哎这种办法是不行他会出现
error: failed to push some refs to gitgithub.com:..... Updates were rejected because the remote contains work that you do not have locally.This is usually caused by another repository pushing to
大概原因就是 意思是本地和远程的文件应该合并后才能上传本地的新文件
搜索提示的解决方法 1、先拉下来会自动合并的git pull origin master2、再上传git push -u origin master 但是还是有错误——无法pull仓库 refusing to merge unrelated histories 这种错误。
大神指出因为两个仓库不同在 2.9.2
之后不可以合并不同没有相同结点的分支如果需要合并两个不同结点的分支
那么需要在git pull 添加一句代码--allow-unrelated-histories。
于是修改之后的代码假如源是origin分支是master
$ git pull origin master --allow-unrelated-histories然鹅我还是有错误……好气哦
好啦不卖关子了超级简易法如下
最后同学提示说
1、直接把github上新建的仓库clone下来
$ git clone gitgithub.com:MeMeLeevv/SnakeGame.git 2、进入该文件夹
$ cd SnakeGame
3、把已经写好的文件复制到该文件夹下
之后步骤添加提交推送到远程库
1、$ git add .我还是偷懒了把全部文件一次性上传……
2、$ git commit -m 第一版缺点1.没有实现在界面中实时显示积分情况 2.没有暂停功能 3./tmp/SGPicFaceTpBq/9848/002FC4B2.png没有加速功能
3、$ git push -u origin master完成
呼~长舒一口气啦