Closed jeluard closed 11 years ago
Great, just one more thing before I merge: could you amend all your commits into a single one, with a meaningful message like "Make sure open throws an Exception when File#listFiles returns null.", and then force push? Feel free to get back if you need guidance.
That will help keeping the commit history easier to understand and navigate :)
Sure! Some guidance will definitively be helpful, git and I are not exactly friends :) What would be the way to fix the current situation? Also how should I do that right the next time given I might want to change things after the first pull request? I am fine restarting from scratch.
Thanks for the help!
Sure :)
First, if you want to commit something, and then you notice you forget to commit something else, rather than committing again, you can "overwrite" the previous commit by using git amend, like: git commit --amend -m "commit message" This will give you a single commit out of your last previous one and what you have right now in your working directory. Then, if you already pushed your previous commit, you have to force push (--force) the amended one, but please do that ONLY if you're pushing to your own repo, otherwise collaborators will hate you forever :)
By the way, this will not help you probably in this case, as I see you have lots of commits (sorry, didn't really notice before) and git amend only works with the last previous one: so I'd suggest to start from scratch and commit/push with a meaningful message.
In the future, just always use good commit messages, and if you want to fix the last previous commit, use git amend with care.
Hope that helps :)
Make sure open throws an Exception when File#listFiles returns null.