I half realize that this question is probably asked already, but I’m not familiar with the jargon and I need a really easy to follow answer perhaps a little too specific to my particular needs.
I forgot to remove the object files and then performed a git add -A. I then scanned a few man pages and used some kind of interactive mode and after some attempts had the object files removed.
I then performed a git push origin master to ‘upload’ the files to the remote server on github.com. It turned into three commits.
So my last four commits consist of:
- 0) A past commit which is fine and dandy.
- 1) A commit with the object files plus the code changes
- 2) A commit where the object files are removed.
- 3) A commit where added a .gitignore file (that someone sent to me over a month ago).
Basically I want the there to be one commit after 0, the diff of which should show all the changes except any evidence of those goddamn object files. How do I do this, if it is possible, please?
Locally, use
git rebase --interactiveor your git tool of choice to get history like you like it. Then usegit push origin master -fto force your version of master into the github repository.Be aware that revising already-published history means that you have to go to everyone who’s already pulled the revised changes and instruct them on getting the new changes, and rebasing away the old ones if they’ve done work on top of them.