小编Tom*_*Tom的帖子

删除未推送的 git 提交,但保留所有本地工作

我的本地目录中有一些大文件,包含在我认为阻止我的 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'
Run Code Online (Sandbox Code Playgroud)

至少,我相当确定是文件的大小导致推送失败。我只想删除提交的记录,这样我就可以返回并为这些文件添加一个 .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 …
Run Code Online (Sandbox Code Playgroud)

git git-commit

3
推荐指数
1
解决办法
5329
查看次数

标签 统计

git ×1

git-commit ×1