0

I'm in a bit of a pickle here. I am trying to learn git and I am running into an issue I still cannot seem to resolve. I am on my current branch main which has 5 commits waiting to be pushed to my remote repository. The one of files in all of these commits is to large to push to my repository and I cannot use git LFS to try and resolve the issue since I am working on a machine where I cannot download stuff.

I deleted the files that were to large and made a commit which is the most recent one. I want to only push the most recent one which represents my current working directory without the large files, without the other commits which wont work. I have tried git push <remote name> <commit hash>:<remote branch name> using my most recent commit (the one that represents the directory without the large files) and still git rejects the push and says there are files that are to large, so I am assuming it is still trying to push them all?

I have also tried making a new branch, commit my current directory and then push but I still get the error.

I am beginning to believe that my most recent commit still has the old ones with the files that are to large somehow embedded in it or something. All I want to do is forget the commits waiting and only push my current directory, any help would be appreciated.

AllinTheSauce
  • 63
  • 1
  • 6
  • 1
    you should rewrite you history and remove the large file. `git rebase -i HEAD~6` and flag commit to amend is a quick solution – Ôrel Apr 02 '23 at 17:30

0 Answers0