Git hard disk drive problems

I am familiar with git and recently made a mistake: from one computer, I added many large files (100 MB each, 70 GB total), committed them and pushed to master. Now I want to take another computer (with a smaller hard drive) and I am stuck.

I cannot completely pull from the remote repository (due to lack of hard disk space), but I also cannot free up the local bloat git repository.

My question is, how can I get my repository back to a state where it doesn't need so much local hard drive space? (I will delete files from next click from another computer).

+3


source to share


1 answer


You need to do

git reset

      

or

git filter-branch

      

with the correct parameters. Rewrite your history.



and then you have to push that with --force to the remote repository. Please note that this will make things a little more difficult for everyone using this repository as they will have to do a redirect or a new clone.

git push --force

      

To remove a commit from your branch. The commit will now be present for another 14 days or so on your remote and on the computer that contains that commit. Either you don't care or you run

git gc --prune=now

      

+1


source







All Articles