Bruno von Paris
Bruno von Paris

Reputation: 902

git suboptimal memory error: how to remove unecessary files from a commit?

I made an error when adding files to a commit: I made a git add directory_name/, which resulted in added very large files (satellites images). Obviously, those images should not be added to the git repository.

When doing a git push, I'm returned "warning: suboptimal pack - out of memory". My idea would be to see what files are in the commit, and remove the large images that should not be there:

  1. How can I see the list of files in the commit?
  2. How can I remove the unwanted files?

Upvotes: 0

Views: 41

Answers (1)

blue112
blue112

Reputation: 56442

What you can do is erase the previous commit with

git reset HEAD^

You can then use git status to see all the tracked / untracked files

git status

Then you can do the commit all over again, without adding the unwanted file.

Upvotes: 1

Related Questions