Skip to content

git lfs migrate --no-rewrite couldn't see files in commit? #3421

@bitinn

Description

@bitinn

Say I have following branches:

  • master
  • update (git checkout -b update from master)

And if I run following command on it:

$ git lfs migrate import --no-rewrite LightingData.asset

It gives me this warning:

fatal: could not rewrite "LightingData.asset": unable to find entry LightingData.asset in tree

But if I run following command:

$ git lfs migrate import --include-ref=update --include="LightingData.asset"

Then it passes just fine:

migrate: Sorting commits: ..., done                                             
migrate: Rewriting commits: 100% (4/4), done                                    
  convert	7b208bf9ddfc5c814e50b5c649fa99f41cef1b2f -> 14da0c07bd6a215b8fd71335579b492b7d7327ee
  master 	7b208bf9ddfc5c814e50b5c649fa99f41cef1b2f -> 14da0c07bd6a215b8fd71335579b492b7d7327ee

$ git lfs ls-files | grep asset

9af25f1c37 - leocities-starter-kit/Assets/Leocities/Scenes/TestSceneA/LightingData.asset
190a5dd172 - leocities-starter-kit/Assets/Leocities/Scenes/TestSceneB/LightingData.asset
108a9f53fd - leocities-starter-kit/Assets/Leocities/Scenes/TestSceneC/LightingData.asset

My .gitattributes contains these 2 lines:

LightingData.asset filter=lfs diff=lfs merge=lfs -text
...
*.asset merge=unityyamlmerge eol=lf

So my question, is this a bug? Is --no-rewrite supposed to do what I think it would do: that is, to migrate the files into LFS without rewriting history?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions