Github large files get corrupted

Asked

Viewed 240 times

3

When I try to upload a file larger than 100 MB, everything works fine in Git. Even in my Github folder the file is normal and the correct size. But when I try to download it in zip to test, the big file gets with 1 KB.

When I import to gitDesktop the files are 1 KB too (the ones bigger than 100 MB).

I have tried with Rar file but when low only says that the file is corrupted. Some solution?

  • Can you send the link from the repository please?

  • Sometimes here you have something that interests you https://answall.com/questions/432787/whereyou can go up

  • 1

    In my view Git should be to control the software version and how it works and new features and organize work between small, medium and large teams ... Already the data should not even (with some exceptions) be "versioned", nor does it make sense this, the data must be part of the environment used and if you need a file larger than 100MB is because there is something wrong, unless it is another software that receives a "bind" from your current application, but still probably have something bad planned in the project itself.

  • Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site

  • You do not score your questions, have no interaction with the crowd, check out the tour of the website

2 answers

6

Git was not created to be used to manipulate large files. This is always at the disadvantage of it when it compares with other version control software. It doesn’t mean it doesn’t work, but it’s not ideal.

For Git has an appropriate mechanism to deal with this need which is the Git Large File Storage (LFS) (has now been commented that you are using it, this should be in the question). It will not solve for Github, which is what you say has problem in the question.

There is even a alternative that Microsoft created in order to work with the Windows repository, but it is not available for you to use on Github, at least on normal and free accounts.

And in fact Github has restrictions on large files as shown in help theirs. This specific size is prohibited, then in this case the solution is not to try to do that.

There may be other options, but you’d have to know the exact context, everything you can and can’t do.

  • So I was using git lfs. I sent all the files (70mb) and left the 100 Mb to send with git lfs. Although it send ok the file gets 1 kb when download. And even compressing in rar and sending everything remains the same thing :/

  • In your question you said you’re using Github

1

Github has a limitation that does not allow files over 100 MB to be versioned into its repositories.

The only way Github officially indicates to Versionar files with more than 100 MB is using the Git Large File Storage (Git LFS).

Basically, Git LFS allows commits to only point to these large files, which will be stored outside your Github repository, keeping within the commit only one pointing to the file that will be in another location.

Installation and use is very transparent. Every repository on Github already has one free account for use of Git LFS, which allows up to 2 GB of storage on the free plan.

Thus, after install the git lfs and do the track of the file types you want to convert to Git LFS:

git lfs track "*.war"

All push to the Github repository will already automatically upload the file to the Git LFS repository:

git add app.war
git commit -m "Add war file"
git push origin master

The return of push will show something like this:

Sending app.war
44.74 MB / 81.04 MB  55.21 % 14s

It is possible change the repository used by Git LFS if you do not want to use the free Github repository.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.