How to I disable git-lfs?

前端 未结 3 1634
粉色の甜心
粉色の甜心 2021-02-01 19:59

I have a repository on bitbucket that is using LFS. Since using it for some time, I\'ve decided to move the repository back to a space under my control. The only reason I used L

3条回答
  •  天涯浪人
    2021-02-01 20:58

    git lfs migrate export

    From git lfs migrate help:

    Export

    The export mode migrates Git LFS pointer files present in the Git history out of Git LFS, converting them into their corresponding object files.

    Example Workflow

    1. Verify you actually have LFS files with git lfs ls-files.
    2. Remove all filter=lfs lines from ALL the .gitattributes files in your repo. .gitattributes can live anywhere so make sure you find them all otherwise this can cause migration issues later.
    3. Commit any changes you made to .gitattributes.
    4. Make sure you have no changes with git status.
    5. Run the migration: git lfs migrate export --everything --include .
    6. Run git status to make sure you have no changes. If you left .gitattributes with filter=lfs you might incorrectly have changes now.
    7. Verify all the previously listed LFS files are no longer present with git lfs ls-files.
    8. Inspect files (e.g., open formerly LFS files to make sure they aren't corrupt) and run your build to make sure everything works.

    Tips

    • Run on case sensitive file system, in case you have file system collisions (e.g. ./LICENSE and ./License) at some point.
    • Git rid of all your filter=lfs lines from ALL your .gitattributes.
    • You may also want to delete LFS remains in .git/hooks directory: pre-commit, post-commit, post-checkout, post-merge.
    • With $GIT_TRACE=1 there should be no sign of ...trace git-lfs: filepathfilter: accepting...

提交回复
热议问题