OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to undo "git push --mirror"?

  • Thread starter Thread starter hyperknot
  • Start date Start date
H

hyperknot

Guest
On a git/github project I am working on a branch. Upon a push, it said the following:

Code:
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:

Code:
git push --mirror

I issued the following command and now it seems that I have deleted a lot of branches from the server.

Code:
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)
<p>On a git/github project I am working on a branch. Upon a push, it said the following:</p>

<pre><code>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.
</code></pre>

<p>I tried to fix this problem and upon Googleing I came up with this line:</p>

<pre><code>git push --mirror
</code></pre>

<p>I issued the following command and now it seems that I have deleted a lot of branches from the server. </p>

<pre><code>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
</code></pre>

<p><strong>Can you tell me what has happened and how can I undo the change I made?</strong> (in case I deleted those branches)</p>
Continue reading...
 
Top