-2

Error when I push to github

I'm trying to push my code in Github but I have a problem. It says that there is file greater than 100mo and can't upload it. However, I removed this file and folder from my local repo.

It says the folder import has a file too big. However, this folder does not exist anymore in my repo.

Anyone knows how I can remove a folder in git that I can't see anymore?

marxan
  • 17
  • 1
  • 3
  • Possible duplicate of https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository – ChrisGPT was on strike Jan 30 '18 at 13:21
  • 1
    @marxan, please include your image into question, do not post on external resources. – Andrejs Cainikovs Jan 30 '18 at 13:24
  • Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – phd Jan 30 '18 at 15:13

2 Answers2

1

As the docs put it, the easiest way to remove a file from a local repository is by deleting the file from the disk, and then recording the removal:

git status
git add filename
git commit -m "removed filename"

Also related Delete deleted files/folder when updating a git repo.

Community
  • 1
  • 1
cosh
  • 470
  • 1
  • 4
  • 15
  • Thanks for your answer, the problem is that folder is not on the disk anymore but seems to be still in my local repo – marxan Jan 30 '18 at 12:02
  • then just record the change, i.e. the removal of the file, by adding and commiting it. this change should be visible when you do `git status`. – cosh Jan 30 '18 at 12:16
0

The file is likely still referenced from some of the previous commits.

You should run git filter-branch - see https://help.github.com/articles/removing-sensitive-data-from-a-repository/#using-filter-branch.

This is a possible duplicate of Completely remove file from all Git repository commit history

Martian
  • 282
  • 1
  • 4