Follow renames when performing git subtree split -
I have several subdirectories that I want to draw in a separate repo with the same command to remove them I take them (rename) in a sub-directory within.
Then I run: If I then check this new branch and Is there a way to preserve full history while doing a sub-to-split? Is there any other means of achieving desired results? I have considered using filter-branch on the repo clone, but I know that it will be very slow. If you want to leave files from or even example: In this way you can get all files / directories (or in the second case, only the first two segments) that were present at the repo at any time. After that you can use the following command to clean the repo: after leaving the file < Code> my_new_subdir I used the combination of the above commands to clear any unnecessary files from history, although I still have got unrelated merge in history, but in the end I am satisfied with the result. Note that the number of parameters for the above guit command is important for running through all the history, branches and tags. To speed things up, you can first identify the largest parts of the repo to remove the repetition git subtree split -p my_new_subdir -b newbranch
git Run the log - Follow some foldfollow This only shows the log entries related to moving to the temporary subdirectory. I want to continue the entire history of those files.
my_new_subdir , then you really need to remove all your files using the concept:
Git filter-branch - tag-name-filter-cat - index-filter \ 'git rm -r - cached --ignore-unmatch unneeded-subdir -1 unnecessary-pattern- * unnecessary- and so on' \ --prune- You can use sth to help find out what else to delete:
GIT log - -name-status --all | Grep -P '^ \ w \ s + [\ S] + $'
git logs - Name-status - All | Grep -P '^ \ w \ s + [\ S] + $' | | \ Sed s /^.// | Cut-F 1-2-D '/' | Sort-u
git gc - agressive
GIT GC - Aggressive . Having I5 CPU and SSD disc took me about a minute to complete a
git filter-branch and about 1000 history entries were processed.
Comments
Post a Comment