VFS for Git
|Branch||Unit Tests||Functional Tests||Large Repo Perf||Large Repo Build|
|Branch||Unit Tests||Functional Tests|
What is VFS for Git?
VFS stands for Virtual File System. VFS for Git virtualizes the file system beneath your git repo so that git and all tools see what appears to be a normal repo, but VFS for Git only downloads objects as they are needed. VFS for Git also manages the files that git will consider, to ensure that git operations like status, checkout, etc., can be as quick as possible because they will only consider the files that the user has accessed, not all files in the repo.
This project was formerly known as GVFS (Git Virtual File System). It is undergoing a rename to VFS for Git. While the rename is in progress, the code, protocol, built executables, and releases may still refer to the old GVFS name. See https://github.com/Microsoft/VFSForGit/projects/4 for the latest status of the rename effort.
Installing VFS for Git
- VFS for Git requires Windows 10 Anniversary Update (Windows 10 version 1607) or later
- Run the latest GVFS and Git for Windows installers from https://github.com/Microsoft/VFSForGit/releases
Building VFS for Git on Windows
If you'd like to build your own VFS for Git Windows installer:
- Install Visual Studio 2017 Community Edition or higher (https://www.visualstudio.com/downloads/).
- Include the following workloads:
- .NET desktop development
- Desktop development with C++
- .NET Core cross-platform development
- Include the following additional components:
- .NET Core runtime
- Windows 10 SDK (10.0.10240.0)
- Include the following workloads:
- Install the .NET Core 2.1 SDK (https://www.microsoft.com/net/download/dotnet-core/2.1)
- Create a folder to clone into, e.g.
- Clone this repo into the
- You can also build in Visual Studio by opening
src\GVFS.sln(do not upgrade any projects) and building. However, the very first build will fail, and the second and subsequent builds will succeed. This is because the build requires a prebuild code generation step. For details, see the build script in the previous step.
The installer can now be found at
Building VFS for Git on Mac
Note that VFS for Git on Mac is under active development.
Ensure you have
Xcodeat least once.
Install Visual Studio for Mac . (This will also install the
If you still do not have the
>= v2.1.300installed [manually install it]. You can check what version you have with
If you're using
Xcodefor the first time, you may have to login to
Xcodewith your Apple ID to generate a codesigning certificate. You can do this by launching
Xcode.app, opening the
PrjFS.xcworkspaceand trying to build. You can find the signing options in the General tab of the project's settings.
VFSForGitdirectory and Clone VFSForGit into a directory called
mkdir VFSForGit cd VFSForGit git clone https://github.com/Microsoft/VFSForGit.git src cd src
Prep your machine to use VFS for Git. The following are all done by the script below.
- install Homebrew
- install and setup the Git Credential Manager (with
- install/update Java (with
- install a VFS for Git aware version of Git
From the src directory run
Troubleshooting if this fails
If you get
xcodebuild: error: SDK "macosx10.13" cannot be located.
You may have the "Xcode Command Line Tools" installed (helpfully by Mac OS) instead of full
Xcode. Make sure
/Applications/Xcode.app/Contents/Developer. If it does not, install
Xcodeand then launch it (you can close it afterwards.)
In order to build VFS for Git on Mac (and PrjFSKext) you will have to disable the SIP (System Integrity Protection) in order to load the kext).
This is dangerous and very bad for the security of your machine. Do not do this on any production machine! If you no longer need to develop VFS for Git on Mac we recommend re-enabling SIP ASAP.
To disable SIP boot into recovery mode (
[Win/⌘] + Rwhile booting your Mac). Once booted into recovery mode open Utilities -> Terminal to launch a terminal. Enter:
csrutil disable # use "csrutil enable" to re-enable when you no longer need to build VFS for Git on Mac
Then click the Apple logo in the top left and restart.
Now you have to load the ProjFS Kext.
Add your built VFS for Git executable (
gvfs) program to your path. A simple way to do that is by adding
Confirm you have it by running
command -v gvfs
You should see a path to the gvfs executable.
Try cloning a VFS for Git enabled repository!
gvfs clone URL_TO_REPOSITORY --local-cache-path ~/.gvfsCache
Note the current use of
--local-cache-path. Without this argument VFS for Git will encounter a permissions error when it attempts to create its cache at the root of your hard-drive. Automatic picking of the cache path has not yet been ported to VFS for Git on Mac.
Trying out VFS for Git
- VFS for Git will work with any git service that supports the GVFS protocol. For example, you can create a repo in
Visual Studio Team Services (https://www.visualstudio.com/team-services/), and push some contents to it. There are two constraints:
- Your repo must not enable any clean/smudge filters
- Your repo must have a
.gitattributesfile in the root that includes the line
gvfs clone <URL of repo you just created>
- Run git commands as you normally would
gvfs unmountwhen done
The VFS for Git source code in this repo is available under the MIT license. See License.md.
VFS for Git relies on the PrjFlt filter driver, formerly known as the GvFlt filter driver, available as a prerelease NuGet package.