I'm working on a branch called Feature.
- I pushed an empty commit 'New' (Commit 1) to indicate the creation of my branch (this is the standard in my company).
- I then edited an important file and pushed it in a second commit (Commit 2). I realized afterwards that my modification actually resulted in an unknown bug.
- I ran a
reset --hard
to go back to the previous, clean commit (Commit 1). - I then re-made my modifications in a clean way and made sure it wouldn't cause any bugs. I pushed my modifications in a third commit (Commit 3).
Now when I run git status
, it tells me my branch Feature and origin/Feature have diverged and each have one commit. I'm guessing I'm going to have to rebase
my branch.
My question is: how am I supposed to go about my commits after a git reset
to make sure I don't have a commit 'behind' that eventually results in a branch divergence? How do you keep on committing and pushing after a git reset
? Did I miss a step?
My company uses TortoiseGit, so all commands are run through a graphic interface.