Git: Any long-term effect of deleting all files in a repo and then rolling back a commit?

In our git repository, we accidentally committed a commit that deleted all of our files. This latch was ported to our central server and was knocked down by other developers and built servers, so rewriting the history to undo this is not ideal. Instead, we did another rollback to restore all the files to their previous state, with another attempt to roll back between them, which somehow restored some files.

cc043989 Rollback commit (goes back to 4bf31def)
f5d7f10e Failed rollback commit
cd60376f Delete all files commit
4bf31def Last good commit
.
.
.

Our concern is whether this will lead to long-term consequences, especially with respect to merging to / from function branches and to / from subtree repositories. If in the future he will constantly do merges or something even more complicated, it may be worth it just to rewrite the history and work with the build servers / other developers manually.

+5
source share
2 answers

Suppose your story looks like this:

A --- B --- C --- D master
 \
  E --- F topic

In commit "B", you accidentally delete all files. In commit "C", you restore all files.

, , . , , ( ).

,

git checkout master
git rebase -i 4bf31def

:

# cc043989 Rollback commit (goes back to 4bf31def)
# f5d7f10e Failed rollback commit
# cd60376f Delete all files commit
4bf31def Last good commit

, . , .

+1

, , . , , , .

Subtrees , , , , , .

0

All Articles