If a change is done upstream between trac git pull and git push, the push will fail. That is expected, a warning will be displayed. Then, the repo will be pulled again. Since the working tree is dirty, it will fail (forever). This fix do a hard reset before every pull. This way, a potentially dirty working tree will be cleaned and the pull will succeed. If we are lucky (most likely to happen), this times, our (trac) changes will be saved.