我真的是github和git的初学者,我在一个基本代码的github上有一个仓库,最近我安装了一个新的操作系统作为备份我的应用程序代码,并添加了很多内容它,当我试图推动修改github上,我得到了一个错误:git命令删除我的东西
[rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我搜索上线,发现这是我执行的命令:
git pull --rebase
这引起了我一个问题,我搜索并找到了我执行的另一个命令以及
git pull origin branchname --allow-unrelated-histories
另一个错误出现了,发现我执行另一个答案:
git fetch origin
git reset --hard origin/master
git pull
这其中除去我已经在我的本地计算机上进行的所有更改,并与基码我曾在更换远程(github)存储库
对不起,我知道无知不是保佑,但现在我问是否有任何方法让我的代码回来?
wooow我刚刚发布了这1秒,看到有人投下了它立即!!!!!无论如何,我不打算处理这些人的更多,请我需要关于这个人的帮助 – medBo
'git reflog'可能有助于文件/更改至少是一些提交的一部分。我确定这里有相关的问题。 –