0

Recently I filled my gitlab server's hard drive and I am looking to free some space, so:

Is it possible to remove files with all of their history?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
pordzio
  • 11
  • 5
  • 1
    possible duplicate of [Completely remove file from all Git repository commit history](http://stackoverflow.com/questions/307828/completely-remove-file-from-all-git-repository-commit-history) – Dylan Corriveau Dec 05 '14 at 13:54
  • and for the remote optimization problem: http://stackoverflow.com/questions/3162786/how-can-i-trigger-garbage-collection-on-a-git-remote-repository – Ciro Santilli OurBigBook.com Dec 05 '14 at 16:51

1 Answers1

1

To get free space,

git gc

is the easiest way. It removes unnecessary files in Git.

If you want to delete specific big size files from history

git filter-branch --tree-filter 'rm some/big/file' HEAD

But please refer to http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History before do it.

If you want to delete entire repository, just delete YOUR_REPO/.git directory.

shirakia
  • 2,369
  • 1
  • 22
  • 33