0

We were maintaining project on gitlab. I was working on feature branch. But did not merge feature branch with master for several months. Now we have moved to github. I merged feature branch with master branch and tried to push to github. It gave me following error:

# git push origin feature-branch
/usr/bin/gh auth git-credential get: 1: /usr/bin/gh auth git-credential get: /usr/bin/gh: not found
/usr/bin/gh auth git-credential store: 1: /usr/bin/gh auth git-credential store: /usr/bin/gh: not found
Enumerating objects: 9228, done.
Counting objects: 100% (7495/7495), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2090/2090), done.
Writing objects: 100% (6033/6033), 72.77 MiB | 7.39 MiB/s, done.
Total 6033 (delta 4402), reused 5194 (delta 3616)
remote: Resolving deltas: 100% (4402/4402), completed with 477 local objects.
remote: error: Trace: c1c90b47a5483929dcdd8c974a6c7d0695e876f67f680d8b88b80ef1c1bce74a
remote: error: See https://gh.io/lfs for more information.
remote: error: File deployment_20200220.sql is 872.78 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/my-org/my-project.git
 ! [remote rejected]     rest-logging -> rest-logging (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/my-org/my-project.git'

I do not recall dealing with this file deployment_20200220.sql. It seems database dump.

I tried finding this file with:

$ sudo find / -name "deployment_20200220.sql"

But no luck.

So I tried to search the file name in git log:

# git log --stat | grep deployment
Merge branch 'deployment-email-fix' into 'master-py3'
Merge branch 'deployment-email-fix' into 'master-py3'
Delete deployment_20200220.sql
deployment_20200220.sql | Bin 915175495 -> 0 bytes
resolved merged conflict on deployment
resolved merged conflict on deployment

and found that the file is deleted in the past. I tried to find out exactly when:

# git log --full-history -- deployment_20200220.sql
commit 2f5ebff56b9bc300ea0f94374842c227745f089e
Author: UserABC <UserABC@gmail.com>
Date:   Thu Oct 1 10:02:15 2020 +0000

Delete deployment_20200220.sql

Though, I know that the file was deleted even before I joined this organization, I dont know why it is troubling now. Also I am unable to guess how can I fix it.

PS: Mine is the first ever commit to new github repo. No one has pushed to new github repo after migrating from gitlab to github.

MsA
  • 2,599
  • 3
  • 22
  • 47
  • 1
    Github wants to prevent to have a huge history to download when cloning. If you want to be able to push to github, you must remove this file from history (and accept all the consequences). This question is duplicate of a lot of previous ones. Search for how to do it. – Philippe Jul 03 '23 at 23:59
  • Install `git lfs` and use it to [manage large files](https://docs.github.com/en/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage). – ElpieKay Jul 04 '23 at 01:51
  • To complete @Philippe's comment: see for example [this answer](https://stackoverflow.com/a/61602985/86072) – LeGEC Jul 04 '23 at 05:25
  • @ElpieKay In this specific case where the big file is not needed and has been removed from working directory it won't help. Because you will have to rewrite the history anyway (to remove it or to migrate to git-lfs) and you will have to pay for this service. So if you don't need it.... – Philippe Jul 04 '23 at 07:49
  • @ElpieKay Apart from what @ Philippe said, I guess turning on lfs it self [requires pushing configs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage). – MsA Jul 04 '23 at 08:39
  • @MsA What you and Philippe said are also mentioned in the link I provided. Well, I'm not writing a manual after all. I thought it would help OP. – ElpieKay Jul 04 '23 at 09:07

0 Answers0