1

I somehow have a file that I didn't commit (at least recently), I can't seem to remove it using:

git rm -r --cached PathToFile

When I check what will be pushed when I push the file I removed is still listed using:

git diff --stat --cached origin/master

Does anybody know what's wrong?

The issue is I can't commit the file because it's over 100MB, it's currently on my .gitingore, but I guess the change to gitignore was made after the file was commited somehow. I don't want LFS, I already maxed it for no reason.

Ofek S.
  • 51
  • 1
  • 12
Rick
  • 353
  • 1
  • 16

1 Answers1

1

Once it is commited, it is added to the chain. So try hard resetting repo or file to the previous version. Refer. Reset or revert a specific file to a specific revision using Git?. Else Use this docs to remove the file from repo history https://help.github.com/articles/removing-files-from-a-repository-s-history/

Seeni
  • 1,518
  • 1
  • 14
  • 22
  • Hard resetting would wipe everything out, cause problems for others using the branch, and is probably not an option the OP would want to use here. – Tim Biegeleisen Jan 11 '18 at 10:17
  • Hard reset will be useful when the only thing he did was adding a new file. – Seeni Jan 11 '18 at 10:20