Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

This is a work in process. Feel free to edit in anyway. I'm still just learning git so stuff I say might be very wrong.

In this case, noted at bottom of this read, a push was accidentally deleting branches.

git push --mirror

kicked off deleting unprotected branches - probably for pull requests these have to be unprotected where other users have rights to them. Correct me if wrong.

so one might look at git reflog and git revert but that may make things worse especially on public repos. Git revert really just creates a commit the exact opposite of what you just did depending.

A better option would be ...

https://stackoverflow.com/questions/3640764/can-i-recover-a-branch-after-its-deletion-in-git

https://git-scm.com/docs/git-revert

https://github.com/blog/2019-how-to-undo-almost-anything-with-git


Branches are really just labels so a revert wouldn't help.

In this caseĀ 


Commands and output:

root@maximus:~/code/rchain# git remote set-url --push origin https://github.com/jeremybusk/mirrored-test
root@maximus:~/code/rchain# git remote -v
origin git@github.com:jeremybusk/rchain (fetch)
origin https://github.com/jeremybusk/mirrored-test (push)
upstream git@github.com:rchain/rchain (fetch)
upstream git@github.com:rchain/rchain (push)
root@maximus:~/code/rchain# git push --mirror
Counting objects: 7, done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 801 bytes | 0 bytes/s, done.
Total 7 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/dev.
remote: error: Cannot delete a protected branch
To git@github.com:rchain/rchain
- [deleted] dev-eitan&kyle-spatial
- [deleted] dev-eitan-docs
- [deleted] dev-eitan-readmes
- [deleted] dev-griff-core-88
- [deleted] dev-kent-build-readme
- [deleted] dev-kent-ubuntu-14.04
- [deleted] revert-70-dev-kent-build-readme
- [deleted] spatial
* [new branch] OPS-35 -> OPS-35
* [new branch] origin/HEAD -> origin/HEAD
* [new branch] origin/OPS-35 -> origin/OPS-35
* [new branch] origin/dev -> origin/dev
* [new branch] origin/dev-eitan&kyle-spatial -> origin/dev-eitan&kyle-spatial
* [new branch] origin/dev-eitan-docs -> origin/dev-eitan-docs
* [new branch] origin/dev-eitan-readmes -> origin/dev-eitan-readmes
* [new branch] origin/dev-griff-core-88 -> origin/dev-griff-core-88
* [new branch] origin/dev-kent-build-readme -> origin/dev-kent-build-readme
* [new branch] origin/dev-kent-ubuntu-14.04 -> origin/dev-kent-ubuntu-14.04
* [new branch] origin/master -> origin/master
* [new branch] origin/revert-70-dev-kent-build-readme -> origin/revert-70-dev-kent-build-readme
* [new branch] origin/spatial -> origin/spatial
* [new branch] upstream/dev -> upstream/dev
* [new branch] upstream/dev-eitan&kyle-spatial -> upstream/dev-eitan&kyle-spatial
* [new branch] upstream/dev-eitan-docs -> upstream/dev-eitan-docs
* [new branch] upstream/dev-eitan-readmes -> upstream/dev-eitan-readmes
* [new branch] upstream/dev-griff-core-88 -> upstream/dev-griff-core-88
* [new branch] upstream/dev-kent-build-readme -> upstream/dev-kent-build-readme
* [new branch] upstream/dev-kent-ubuntu-14.04 -> upstream/dev-kent-ubuntu-14.04
* [new branch] upstream/master -> upstream/master
* [new branch] upstream/revert-70-dev-kent-build-readme -> upstream/revert-70-dev-kent-build-readme
* [new branch] upstream/spatial -> upstream/spatial
! [remote rejected] dev (protected branch hook declined)
error: failed to push some refs to 'git@github.com:rchain/rchain'
root@maximus:~/code/rchain# git config

  • No labels