2

I have a repository for my website and I keep my photoshop .psd files in it which can be quite large (I have one that is 174mb large).

When I edit it it obviously uploads the whole thing again, which I'm not too bothered about because I only push it when I don't need to use the computer for a while.

The problem is though, I have a .git folder that is nearly 2gb because of all the previous versions.

I want to keep the old psd files on BitBucket as a backup but I want to get rid of them locally. Is this possible?

If not, I will delete them and back them up elsewhere.

  • This may not fit your needs (and doesn't exactly answer your question), but there is a tool designed to handle huge files in git named [git-annex](https://git-annex.branchable.com/). – Dettorer Nov 05 '14 at 13:38

1 Answers1

3

I think you just need a shallow clone. If you have pushed everything; you can just remove your local folder; and clone again with the --depth parameter:

git clone --depth=5 <repo-url>

This will only give you the last 5 commits from your repository; while at your remote you will still have the whole history. Off course this is valid for all your commits; not only for the ones related to your .psd files.

EDIT : off course removing your directory and then cloning it again is overkill; you can just remove your old history; but its less intuitive; you can get some inspiration here

Community
  • 1
  • 1
Chris Maes
  • 35,025
  • 12
  • 111
  • 136