diff options
author | https://id.koumbit.net/anarcat <https://id.koumbit.net/anarcat@web> | 2015-02-17 00:58:38 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2015-02-17 00:58:38 +0000 |
commit | de14e6de97078e2dab4ac4437be2140700524132 (patch) | |
tree | e51890d81388a00b36d50e5cb9210c332d77cc5f | |
parent | 252304e6f0309bee9d78a2b50a714590084c3769 (diff) |
Added a comment: the actual process i use
-rw-r--r-- | doc/forum/canceling_wrong_repository_merge/comment_3_d6e45d7e4f4bdf0a08ab91a08e0c1be6._comment | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/forum/canceling_wrong_repository_merge/comment_3_d6e45d7e4f4bdf0a08ab91a08e0c1be6._comment b/doc/forum/canceling_wrong_repository_merge/comment_3_d6e45d7e4f4bdf0a08ab91a08e0c1be6._comment new file mode 100644 index 000000000..1fbec8603 --- /dev/null +++ b/doc/forum/canceling_wrong_repository_merge/comment_3_d6e45d7e4f4bdf0a08ab91a08e0c1be6._comment @@ -0,0 +1,37 @@ +[[!comment format=mdwn + username="https://id.koumbit.net/anarcat" + subject="the actual process i use" + date="2015-02-17T00:58:38Z" + content=""" +So it seems i am able to forget all of this within the matter of a few days, and since this is so error prone, here goes a more detailed explanation. + +What I do is: + +<pre> +git clone repo repo.test +cd repo.test +git annex indirect # be safe! this may take a while, but it's necessary! +git tag bak # keep track of a good working state +git log --stat --stat-count=3 # find the commits we want to trash +git tag firstbad badbeef1 # the first commit we want to kill +git tag keep dada1234 # the first commit we want to keep +git rebase -p --onto firstbad^ keep # drop everything between firstbad (inclusive) and keep (exclusive) +git diff --stat keep # make sure this did what we expected +git branch -D annex/direct/master synced/master # destroy this old branch that still has refs to the old commits +</pre> + +Then for each repo: + +<pre> +cd repo +git tag bak +git fetch origin # sync the master branch in +git remote prune origin # make sure the dropped branches are gone +git annex indirect # be safe +git reset --hard origin/master +git branch -D synced/master annex/direct/master +git diff --stat bak # should change +</pre> + +It would be useful to have that transition propagate properly everywhere so I don't have to do this in every repo, but at least the above should work fairly reliably. +"""]] |