On a git/github project I am working on a branch. Upon a push, it said the following:
git push
To [email protected]:...
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:...'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
I tried to fix this problem and upon Googleing I came up with this line:
git push --mirror
I issued the following command and now it seems that I have deleted a lot of branches from the server.
Total 0 (delta 0), reused 0 (delta 0)
To [email protected]:...
- [deleted] develop
+ 797beee...bafbc50 master -> master (forced update)
- [deleted] milestone
- [deleted] robot
- [deleted] strategy
* [new branch] origin/HEAD -> origin/HEAD
* [new branch] origin/develop -> origin/develop
* [new branch] origin/master -> origin/master
* [new branch] origin/milestone -> origin/milestone
* [new branch] origin/robot -> origin/robot
* [new branch] origin/robot_simulator -> origin/robot_simulator
* [new branch] origin/strategy -> origin/strategy
* [new branch] origin/vision -> origin/vision
Can you tell me what has happened and how can I undo the change I made? (in case I deleted those branches)
git push --help
(which is justman git-push
), in the section it mentions, it explains about the "problem", and describes the primary ways to deal with it...