microsoft / microsoft/VFSForGit

Git Restore Fails with "did not match any file(s) known to git"

Open
#1,812 20 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Running git restore for a particular file appears to be not be compatible with GVFS. Repro below:

$commit = git log -1 --pretty=%H
git ls-tree -r --name-only $commit some/file.cpp
some/file.cpp
git restore --source=$commit some/file.cpp
error: pathspec some/file.cpp' did not match any file(s) known to git

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported sequence with git log, git ls-tree, and git restore for the same commit and path. Investigate the GVFS handling of git restore when the path is present in the commit tree. Done means restoring some/file.cpp from the specified commit succeeds without the pathspec error, with the reproduction verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.