1

I am having "File size limit of 100.00" in previous commit due to one file. I do not want to upload this zip file but now is commited in local and it is 2 commits before the one I am now.

Everytime that I am trying to push the new commits it shown me the error again, because it is trying to push the previous ones as well.

The stack it is the following:

Commits

Commit1 (Actual) Commit2 f0ce53a Commit3 ... 

The zip file is in f0ce53a, also in this commit there are some changes that I want to push them.

There is any way to push the commit f0ce53a without the zip file?

Thank you so much, if you need any further information let me know.

1

1 Answer 1

2

One way to fix the problem is an interactive rebase (see here for documentation):

git rebase -i Commit3 

You'll get an editable text file that looks like this:

pick f0ce53a Add a big pesky zip file and some other stuff pick Commit2 Misc. changes pick Commit1 Misc. changes 

There will be some helpful commented lines at the bottom of the file listing the various possible commands. The ones we care about are pick, which means the commit should be used as is, and edit, which will stop the rebase at the given commit to allow us to amend it.

f0ce53a is the commit where the zip file was added so we'll change pick to edit on that line, leaving us with:

edit f0ce53a Add a big pesky zip file and some other stuff pick Commit2 Misc. changes pick Commit1 Misc. changes 

Save the file and quit (vim: :x), and you'll be on the problem commit. Remove the zip file and amend the commit, then continue the rebase:

git rm foo.zip git commit --amend git rebase --continue 

You've rewritten history as though the zip file was never committed.

Sign up to request clarification or add additional context in comments.

3 Comments

Tons of thank you for the answer seems everything is working fine, but I am in last step and I am receiving that: foo.zip: needs update You must edit all merge conflicts and then mark them as resolved using git add
@Eironeia just delete (or move) the zip in your file system
Solved, tons of thanks for such a good answer. Everything already pushed!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.