I've been working on a project and things got sloppy. I've reset
to a stable commit, but when I try to push
I'm told "the current branch is behind its remote counterpart" (obviously). The only option that Git gives me to perform is git pull
. When I try that I'm back to the newer, sloppy commits that don't work and I don't want.
I made a different branch called stable
and ran reset --hard
to the stable commit and then tried the following:
$ git checkout stable
# => Switched to branch 'stable'
$ git merge -s ours master
# => Already up-to-date.
$ git checkout master
# => Switched to branch 'master'
# => Your branch is behind 'origin/master' by 9 commits, and can be fast-forwarded (use "git pull" to update your local branch)
$ git merge stable
# => Already up-to-date.
After running these commands my master
branch is still in the state that I want to get rid of.
I'd like to have stable
be the new master
but am unsure what to do now.