I screwed up. I modified my .gitignore to inadvertantly start tracking a directory of misc files that are huge. When I pushed to origin I realized it was taking forever and saw my error. I have removed (I think) the files from being tracked, but now whenever I go to push again it somehow picks up right where it left off before — in the middle of uploading all those huge files. I keep control-c to stop the push. I want to stop git from resuming previous push and just push afresh this lastest commit.
I screwed up. I modified my .gitignore to inadvertantly start tracking a directory of
Share
Even if you removed the file in the next commit, the old commit is still there and that will still be pushed.
You have to do a
git reset --hard <sha hash of commit before adding the misc files>.Once you do above, the commit where you added the files will be gone. You can now start working and push.
If you have other commits ( that you need) between adding those files and now, you can do a
git rebase -i <hash before file adding>and remove the commit where you added the files