New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple steps to uninstall Git LFS from your repository #3026
Comments
|
Hi @chase-moskal, thanks for opening this. I agree with the steps you outlined above, and left a few specific thoughts below. In one sense, I'm glad that we have this issue open in order to point people in the right direction should they want to uninstall Git LFS, but in another sense I think that this 5 (6?) step process is too complicated, and should be handled by Git LFS. Another confusing aspect of this is that As you noted, this does not rewrite history, so checking out previous revisions of your repository under Git LFS will check out pointers, not large objects. Here are some specific thoughts:
This could occur before step (2) and instead of step(1), which would leave Git LFS installed on your system (in the case that you might interact with a repository that is using it in the future) but would make step (2) do what you expect. Even though Git LFS is configured in Another caveat of this case is that you must have a local cache of all Git LFS objects for this to work, which you can accomplish by
They should simply pull and checkout the new state of the world, their repository will work as-expected without Git LFS installed. |
|
Thanx, that helped me a lot while I was migrating from BitBucket to AWS CodeCommit. Some helpful hints:
|
|
As of Git 2.16, the gnarly piece of this process—re-staging the files that were previously in LFS so their contents are in Git again—can be handled entirely using |
To clarify, this does not affect earlier revisions of history: if you "remove" Git LFS from your repository and check out a historical revision of your repository, you will not see the large files, and instead only see the pointer representation.
|
Replaces Git LFS tracking of images and fonts with regular git tracking using the approach suggested in [1], because GitHub Pages does not support Git LFS files (as of writing). Removing Git LFS entirely was selected over updating URLs to absolute GitHub paths (as done in [2]) as it's simpler to manage going forward. [1] git-lfs/git-lfs#3026 (comment) (not using the subsequent comment's '--renormalize' due to old Git version). [2] git-lfs/git-lfs#1342 (comment)
|
LPT: do not remove |
It's not used anymore and only made my git client complain. See git-lfs/git-lfs#3026 (comment)
|
I summarised everything mentioned above into a gist, please check it out, maybe it helps others in the future like it helped me. Thanks everyone! https://gist.github.com/everttrollip/198ed9a09bba45d2663ccac99e662201 |
|
Especially thanks for your script, it saved ton of my times. @fedor57 longnx@DESKTOP-D46DU6R MINGW64 /d/git/working/edp-ibs-jidou (master)
$ git push gitlab
Enumerating objects: 444, done.
Counting objects: 100% (444/444), done.
Delta compression using up to 4 threads
Compressing objects: 100% (245/245), done.
Writing objects: 100% (444/444), 19.27 MiB | 4.65 MiB/s, done.
Total 444 (delta 190), reused 377 (delta 182), pack-reused 0
remote: Resolving deltas: 100% (190/190), done.
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To https://gitlab.com/dps-ss/edp-ibs-jidou.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://gitlab.com/dps-ss/edp-ibs-jidou.git'
|
|
easiest way to do it that worked for me : then manually remove lfs stuff from .gitattributes |
FYI, I had this same error when I tried to push a repo to GitLab that at one time had LFS files in its history. I was able to finally fix it by:
After that, I was able to push the repo up to GitLab without the |
That worked well!!! Thank you. |
…h Google Cloud Build based on instructions from git-lfs/git-lfs#3026 (comment)
|
Removing the following files worked for me: |
So simple and it worked!! Thanks 😄 |
|
The git add did not work.
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
Guilherme A. Lima da Silva
Em ter., 1 de jun. de 2021 às 06:41, Hugo Marques ***@***.***>
escreveu:
… easiest way to do it that worked for me :
first commit & push everything
then
git lfs uninstall
then manually remove lfs stuff from .gitattributes
git lfs untrack '<pattern>' (in my case, all files "*.*")
git add --renormalize .
git commit -m 'Restore file contents that were previously in LFS' ```
So simple and it worked!! Thanks 😄
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3026 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUT7CVFJGUNZVRF62C7ULTQSTONANCNFSM4FBVUF7A>
.
|
|
It was missing a dot after renormalize
git add --renormalize .
Now it worked
Guilherme A. Lima da Silva
Em ter., 1 de jun. de 2021 às 10:35, Guilherme Araujo Lima da Silva <
***@***.***> escreveu:
… The git add did not work.
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
Guilherme A. Lima da Silva
Em ter., 1 de jun. de 2021 às 06:41, Hugo Marques <
***@***.***> escreveu:
> easiest way to do it that worked for me :
> first commit & push everything
> then
>
> git lfs uninstall
>
>
> then manually remove lfs stuff from .gitattributes
>
> git lfs untrack '<pattern>' (in my case, all files "*.*")
>
> git add --renormalize .
>
> git commit -m 'Restore file contents that were previously in LFS' ```
>
>
> So simple and it worked!! Thanks 😄
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#3026 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADUT7CVFJGUNZVRF62C7ULTQSTONANCNFSM4FBVUF7A>
> .
>
|
|
But LFS it is still there
remote: Resolving deltas: 100% (90/90), completed with 46 local objects.
remote: *warning*: GH001: Large files detected. You may want to try Git
Large File Storage - https://git-lfs.github.com
<https://signaldmain.website/click?redirect=https%3A%2F%2Fgit-lfs.github.com&dID=1622556604166&linkName=https://git-lfs.github.com>
.
remote: *warning*: See http://git.io/iEPt8g
<https://signaldmain.website/click?redirect=http%3A%2F%2Fgit.io%2FiEPt8g&dID=1622556604166&linkName=http://git.io/iEPt8g>
for more information.
remote: *warning*: File countries/historyIC_v2.ipynb is 89.84 MB; this is
larger than GitHub's recommended maximum file size of 50.00 MB
remote: *error*: GH008: Your push referenced at least 10 unknown Git LFS
objects:
remote: 4d2cbfc64508dd56b52a298ff2c50b1f0610a7ec38dcc76d8218031b33b87ed1
remote: 25b74c60ba87ffc7e6d24da2ecffbc98e90833e890742d5d06f7d7fa8fbc1b96
remote: 4a6428cb65e7a4035753589d2f3af12f6441ba89b3712134006b0cb38134b983
remote: ...
remote: Try to push them with 'git lfs push --all'.
To https://github.com/gasilva/dataAndModelsCovid19.git
<https://signaldmain.website/click?redirect=https%3A%2F%2Fgithub.com%2Fgasilva%2FdataAndModelsCovid19.git&dID=1622556604166&linkName=https://github.com/gasilva/dataAndModelsCovid19.git>
Guilherme A. Lima da Silva
Em ter., 1 de jun. de 2021 às 11:07, Guilherme Araujo Lima da Silva <
***@***.***> escreveu:
… It was missing a dot after renormalize
git add --renormalize .
Now it worked
Guilherme A. Lima da Silva
Em ter., 1 de jun. de 2021 às 10:35, Guilherme Araujo Lima da Silva <
***@***.***> escreveu:
> The git add did not work.
>
>
> Nothing specified, nothing added.
>
> hint: Maybe you wanted to say 'git add .'?
>
> hint: Turn this message off by running
>
> hint: "git config advice.addEmptyPathspec false"
>
>
> Guilherme A. Lima da Silva
>
>
> Em ter., 1 de jun. de 2021 às 06:41, Hugo Marques <
> ***@***.***> escreveu:
>
>> easiest way to do it that worked for me :
>> first commit & push everything
>> then
>>
>> git lfs uninstall
>>
>>
>> then manually remove lfs stuff from .gitattributes
>>
>> git lfs untrack '<pattern>' (in my case, all files "*.*")
>>
>> git add --renormalize .
>>
>> git commit -m 'Restore file contents that were previously in LFS' ```
>>
>>
>> So simple and it worked!! Thanks 😄
>>
>> —
>> You are receiving this because you commented.
>> Reply to this email directly, view it on GitHub
>> <#3026 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AADUT7CVFJGUNZVRF62C7ULTQSTONANCNFSM4FBVUF7A>
>> .
>>
>
|
|
@gasilva That error message is an error from the "GitHub server", not from you running the "git-lfs client". That error message says you have a file the violated the GitHub max: GitHub has a policy, where they no longer allow you to push a commit that contains files larger than 50MB. So the "GitHub server" is telling you "You need git lfs" |
|
This worked for me: git lfs uninstall |
did you tried clone, update, commit, push from another local repo? |
This does not work, git lfs ls-files still produces a list of tracked files. Also misses a rm files.txt |
|
I just ended up git rm "all the tracked git lfs tracked files". I dont want to deal with any git rewriting and this allows me to continue my work:) |
|
I used also it's necessary to have write access to .git directory |
|
Created a Python script to do this: https://gist.github.com/tigerhawkvok/adb7905a2423312f237da1953d6a8eeb Should work on all platforms (including Windows), and can generate a dry-run script for you to inspect. (Note the dry-run script won't actually edit your |
Sadly this approach didn't work for me - like @florianseidlschulz, I still get files listed when I run EDIT: I think I resolved this. I'm not sure how git-lfs detects lfs files, but I used filter-repo to remove the file from the index. Now it no longer shows up in git-lfs. Also, worth noting that lfs leaves other hooks in |
it's time to settle this topic once and for all, because answers raised in previous issues about this have proven insufficiently formulated, or are simply outdated with deprecated commands (#316, #641, #910)
i was delighted when git lfs was so easy to install and get started with — but it starts to feel frustrating when git lfs is difficult and confusing to break up with — and boy am i confused
so let's make this easy together — and remember — its not you, it's me
ok ok.. i'm seeing someone else.. it's github pages! (github pages doesn't support lfs)
git lfs uninstallthis removes hooks and smudge/clean filter configuration
and this is only the beginning, mua-ha-ha
how can we reindex/re-commit lfs'd files to restore them???
in this comment @andyneff says:
good thing i read just now that this must be done before the .gitattributes step
but how the heck do we do this? (sure don't want to accidentally change all my newlines, hah)
is there a way that git lfs can do this for me? after all, it was the one who created this mess to begin with.. ok, ok, i know that line never works in any relationship ;)
edit: ok, there's some talk in this issue about a methodology
git lfs ls-files— view lfs filesgit rm --cached myfile.psd— "remove" the lfs filegit add myfile.psd— add the "normal" filegit commit -m "restore files from lfs"let me know if that makes sense
remove lfs
.gitattributeentriesthis will apparently prevent lfs from resurrecting itself
how do we remove remaining files, seen viagit lfs ls-files???i'm guessing we
git lfs untrackthem one-at-a-timeedit: nope, untrack doesn't remove them... hmm... what does it do?
maybe once i figure out step 2, this'll be done
edit: yep, step 2 knocks this one out
what do we tell our fellow contributors to do???
i'm guessing they just need to
git lfs uninstall?do they also need to
git lfs untrackstored files or anything like that?also, i have no interest in rewriting git history here, that's silly... i just want to move forward with my collaborators once this is taken care of
oh, and obviously, i need some help with the points ending in lots of question marks — once we work through this, i'd like to edit this post into a nice clean list of steps that people can follow — then maybe let's formalize this into some documentation
thanks fellas
The text was updated successfully, but these errors were encountered: