Zum Inhalt springen

Git Aufräumen

Aus Computech CMS Wiki

Massnahmen, um im GIT-Repo Platz zu schaffen.

Unbenutzte Programmfiles von GIT löschen

git gc --aggressive


Alte Commits abschneiden

Workaround, um alte GIT-Commits aus dem Repository zu löschen.

git checkout --orphan temp $1      #create a new branch without parent history
git commit -m "Truncated history"  #create a first commit on this branch
git rebase --onto temp $1 master   #now rebase the part of master branch that we want to keep onto this branch
git branch -D temp                 #delete the temp branch

git gc --aggressive                # aggressively collect garbage; may take a lot of time on large repos

Quelle: Stackoverflow: How do I remove the old history from a git repository?


Files aus der gesamten GIT-History löschen

https://help.github.com/articles/removing-sensitive-data-from-a-repository/

https://rtyley.github.io/bfg-repo-cleaner/