TL;DR Make git "forget" the pending commits to local that are ahead of master.
Hello Folks,
I have a git setup. And here is the problem in step-by-step format:
- Create a subproject that has a 10+MB file
- git add .
- git commit -a -m "blah blah".
- Figure out this file shouldn't be in Git at all.
- Modify .gitignore by adding the following line largefiledir/
So, now my git is ahead of master, by a commit. I want git to forget this commit, and then redo the "git add . /git commit" process as if it's never seen the newer files before WHILE adhering to the modified .gitignore file.
How on earth do I accopmlish this? I apologize for my question, but I ran into some posts talking about using "git rebase" and last time I tried that, I ended up throwing away my working directory and checking out from master again.
Any help is greatly appreciated.