git push失败
不知道弄错了什么
上传项目到github上失败
git commit的时候提示
On branch master
nothing to commit, working tree clean
git push 时提示
To https://github.com/Vokiinnn/Scenic_evaluate.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Vokiinnn/Scenic_evaluate.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
百度了一下,用到了这个方法
git pull origin master --allow-unrelated-histories
输入已上命令后,会出现一个文本文档,保存后退出,再次push 成功。。
原理还未知,先记录一下,以后更新。
————————————————————————————————————
原理:当前的代码和github上的代码冲突了,执行命令后把当前的代码暂时保存,不提交,然后下载GitHub上master分支上的最新代码,再合并当前代码和pull下来的最新代码。
用 cat 文件名 查看文件的内容。
合并后的代码如下:<<<<<<<<< GitHub上的 ========== 本地的 >>>>>>>>
<<<<<<< HEAD
git4 add test4
git6 add test6
=======
git4 add test5
>>>>>>> 044d7590ebcd986df8c3c4539e53b14865b2504f
合并后直接push的话,会把<<==>>的内容全部push到GitHub,需要对文件进行修改,可以进编辑器修改,也可以直接vim 文件名 进行修改。
修改后再次push就可以了。
不知道弄错了什么
上传项目到github上失败
git commit的时候提示
On branch master
nothing to commit, working tree clean
git push 时提示
To https://github.com/Vokiinnn/Scenic_evaluate.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Vokiinnn/Scenic_evaluate.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
百度了一下,用到了这个方法
git pull origin master --allow-unrelated-histories
输入已上命令后,会出现一个文本文档,保存后退出,再次push 成功。。
原理还未知,先记录一下,以后更新。
————————————————————————————————————
原理:当前的代码和github上的代码冲突了,执行命令后把当前的代码暂时保存,不提交,然后下载GitHub上master分支上的最新代码,再合并当前代码和pull下来的最新代码。
用 cat 文件名 查看文件的内容。
合并后的代码如下:<<<<<<<<< GitHub上的 ========== 本地的 >>>>>>>>
<<<<<<< HEAD
git4 add test4
git6 add test6
=======
git4 add test5
>>>>>>> 044d7590ebcd986df8c3c4539e53b14865b2504f
合并后直接push的话,会把<<==>>的内容全部push到GitHub,需要对文件进行修改,可以进编辑器修改,也可以直接vim 文件名 进行修改。
修改后再次push就可以了。