Did some data analysis which resulted in generating a huge data file, greater than 100 MB. Accidentaly, tried to push it to Github and the nightmares began!
Keep getting error messages, cant push because large files detected.
The following solution worked for me;
- Open command shell in the repo
- type,
git status - After this, you should see something along the lines of
`On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits)
nothing to commit, working tree clean`
The important part is the "2 commits"! From here, go ahead and type in:
git reset HEAD~<HOWEVER MANY COMMITS YOU WERE BEHIND>
So, for the example above, one would type:
git reset HEAD~2
After you typed that, your "git status" should say:
On branch master Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Now, you can push the commit again. Yay.
Didn't work for me, this one did https://stackoverflow.com/questions/19573031/cant-push-to-github-because-of-large-file-which-i-already-deleted