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
Encountered 1 file(s) that should have been pointers, but weren't #1939
Comments
Hey, thanks for the report. The problem is that you have a file that should be using LFS (according to a pattern in The hanging command is fixed with #1932, which is slated for LFS 2.0.0. I wanted to backport that for a new 1.5.x bugfix release though. |
hey, thanks for getting back to me. I actually want to files entirely, so I can checkout another branch. I usually do a git stash, and that gives me a clean git status. but this time, stash just hangs indefinitly. |
Run |
ok. I'll try that next time. Funny, we couldn't find lfs uninstall, and ran into your post from almost two years ago saying LFS uninstall didnt exist. Either way, I'm sure your solution will work. I think I can close this issue. thanks so much! |
Thanks for the feedback! I'll be really curious to hear your thoughts after v2.0 launches :) But don't be shy about filing further issues in the mean time.
Couldn't find it where? Do you mean under "High level commands" when you run just |
Tpying in "git lfs" shows the install command, but not the uninstall command in git bash!! However, I can confirm that lfs uninstall and install worked for us! |
Issue still exists... |
This issue is still a problem - running in CI, if anyone doesn't install LFS and checks in an LFS-marked file as a normal binary file, the build machine gets stuck because it can't swap branch any more. There needs to be a way to checkout 'clean' (i.e. without fixing up pointers). Uninstalling and reinstalling LFS every build sounds like it could create issues for other build operations running in parallel. |
Uninstall and re-install just ain't working. My co-worker committed without having LFS installed. I think it broke everything. Now I am trying to fix this mess. |
Same situation here. Someone committed without LFS installed, uninstall command runs without complaint but then when I try to checkout the file I get the same error again. |
|
i had this problem and git lfs migrate import --include="*.file extension that is the problem file " worked! |
Is there a permanent fix? Is there a way to push(git lfs migrate import) it to the repository hosted in github? |
Yes! |
Is there an equivalent for people migrating away from lfs? |
@trejkaz: no, not currently. Something like That said, if the total size of your objects doesn't fit on disk, I am not sure if this is a likely scenario given what I imagine the typical use-cases of LFS to be. I wonder if it would be sufficient to download all objects in range, and then do the migration. Another thing that people would have to be aware of is that there is currently no way to communicate "I want to remove this object" over the LFS API. I think that we would have to add this (potentially in a way that is extensible or supports the idea of "object expiration") before adding a @technoweenie what do you think? |
I'm all for an The idea of a delete operation in the batch api kind of scares me though. It'd be really easy to blow your data away, and I don't know what the backup/undo status of other LFS servers is. I'd just rely on LFS servers providing these capabilities. |
I think that that's fair. What do you think about shipping this in v2.5.0? |
This does not seem to be the case.
|
@sandersaares presently, you must specify the patterns that you wish |
Is there a way to have So I added/pushed
Is getting annoying for this file, because I actually want it in git, not in LFS... :( I can't ignore this error. Normally, I can see how useful this helpful message would be though. |
Certainly. You can accomplish this with: $ git lfs migrate import --everything --include='*.png' --exclude='myfile.png' |
That helped, I ended up adding To avoid this hell:
I just had to |
Thanks a lot. I do not know if I have time for the pull request, but I have written a working solution using git lfs migrate import --everything$(awk '/filter=lfs/ {printf " --include='\''%s'\''", $1}' .gitattributes) (You can test it with Can this be integrated? |
Can this be integrated?
Nice. That's a good solution, although it does not migrate locations
that were supposed Git LFS pointers historically (and were marked
appropriately as such), but have since been exported to no longer be,
and are thus no longer corrupt.
We shipped in v2.5.0 a new option to 'git lfs migrate import' called
'--fixup' which does just that. Before migrating a new commit, we read
all of the .gitattributes file(s) that we need to determine which
files at that point in history need to be converted.
Then, we do the conversion one by one, in effect simulating what you
wrote above at _every_ point in history (e.g., where the awk(1) command
is invoked at each historical view of the repository instead of the
tip).
So, I think that the one-liner that you're looking for is:
$ git lfs migrate import --fixup --everything
Does that suit your purposes?
|
Could anyone supply an example of this syntax? I'm having a hard time specifying to only import a range of commits. Any commands I attempt to run either migrate every commit in history or nothing at all. |
While you can use If you do want to fix the history, and you want to include the |
Sorry, I can be more explicit. The commits look like this:
The problem commit is Is there a way to do that? |
Also, thanks for the quick response! |
Sure, you can specify the branches as |
Sorry, I can't seem to get this syntax to work. I'm running something like this: $ git lfs migrate import --include '*.png' G ^B
migrate: override changes in your working copy? [Y/n] y
migrate: changes in your working copy will be overridden ...
migrate: Fetching remote refs: ..., done
migrate: Sorting commits: ..., done
migrate: Rewriting commits: 100% (0/0), done
migrate: Updating refs: ..., done
migrate: checkout: ..., done
|
Also, this is the version I'm on: $ git lfs version
git-lfs/2.5.2 (GitHub; darwin amd64; go 1.11.5) Is this something that only works in a newer version of |
Wait, do they have to be actual branches? Or do commit SHAs work? I've been specifying SHAs, but you've been saying branches. |
Just tried making some branches, but no change. |
They do have to be branches. If you don't use This should work in older versions, since we haven't changed things there recently. |
That works. Thanks for the help! |
God, this is just the answer for me. I don't know if anyone else has the same issue: Environment:
Scenario:
Anyone has an idea why this would happen? |
This one worked for me. Thanks. |
An easy solution to fix this, which will make its way into the Git FAQ soon, is to do this: $ git add --renormalize .
$ git commit -m "Fix broken LFS files" Note that that requires a decently recent Git for the |
so glad for this fix :D i have a love/hate relationship with git lfs |
@kagJacky Line endings? Same thing happened to me; I committed the changes and might have messed up some files... This was a few days after a commit with large changes to my .gitattributes, with many added filetypes (all |
I've found a simple solution, and it helped me: $ git rm .gitattributes
$ git reset HEAD --hard |
Ouch, came across this piece of advice to deal with an unexpected "Encountered 1 file(s) that should have been pointers, but weren't in our repo and since I didn't have any better commit, I chose HEAD and ended with my entire repo converted into LFS pointers including the .gitmodules file which then caused git fetch origin to fail. So, be very careful about running this command without understanding the consequences. Perhaps the --no-rewrite option would have helped. I do not know. (No lasting damage was done - only one branch was re-written and I could recover the original from the reflog) |
Hi, this is my first time posting, and has been my first time using git, so please let me know if I'm making some embarrassing mistakes :)
We're using git lfs for a company project, and my computer has been the only one where lfs checkouts hang indefinitely. The branch status is marking a bunch of files dirty that dont exist. I'm getting the error;
Encountered 1 file(s) that should have been pointers, but weren't when attempting to checkout an individual file.
This issue seems similar to #1900 that is still being addressed...so there doesnt seem to be an obvious solution yet. What can I do to resolve this issue?
Doing a checkout --force with GIT_TRACE_PACKET flag returns a HUGE dump of what looks like an ASCI representation of the file ( hundreds of lines ). The command simply hangs after that.
Thank you!
The text was updated successfully, but these errors were encountered: