I had a developer messing up the develop branch for a few weeks now without telling me and pushing the code to the remote server, I ended up after having a lot of meetings would like to replicate/clone/mirror the master branch into my development branch.
Yes I know I will be losing all the development work and that's OK right now.. I need a stable start and clear start that would be master.
So how to make my develop completely replicate/mirror my master branch?
I did the following:
git checkout develop
git reset --hard master
git commit -am "head reset"
git push
and I got the following error:
! [rejected] develop -> develop (non-fast-forward) error: failed to push some refs to 'ssh://git@xxx/project' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
so after getting the error I did this:
git push --force
but then if I do a pull it will pull then all the old code again... Please help me out