我在本地目录中有一些巨大的文件,这些文件已经包含在提交中,我认为这些文件正在阻止我的git push继续进行:
Counting objects: 194, done.
Delta compression using up to 4 threads.
Connection to bitbucket.org closed by remote host.
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (190/190), done.
error: pack-objects died of signal 13
error: failed to push some refs to 'myrepo'
我相信是文件大小导致了推送失败。我只想删除提交记录,这样我就可以回去添加一个.gitignore文件来忽略这些文件,再次提交和推送。
使用git status命令会显示:
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
我是否能删除提交记录,同时保留本地工作目录中的所有更改呢?我正在寻找一个方法,不需要将代码库重置为较早的主分支(我希望保留所有最近的本地工作!)。任何建议将不胜感激。