Last active
October 26, 2021 05:29
-
-
Save minlaxz/006102cc14f1519cd0284ffbedf2db1c to your computer and use it in GitHub Desktop.
Revisions
-
minlaxz revised this gist
Oct 26, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Check git repo size : `git count-objects -v` First checkout to the commit, which you want to make as the initial commit. Then run the following commands : ``` -
minlaxz created this gist
Oct 26, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ First checkout to the commit, which you want to make as the initial commit. Then run the following commands : ``` git checkout --orphan temp_branch git add -A git commit -am "Initial commit message" git branch -D main git branch -m main git push -f origin main git gc — aggressive — prune=all # remove the old files ``` The above commands will force fully push the current source code to `main` branch as the first command. Note : You should delete all other branches and tags, because it may still contain the old history.