Scalar: A set of tools and extensions for Git to allow very large monorepos to run on Git without a virtualization layer
main
Code
Launching GitHub Desktop
If nothing happens,download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens,download GitHub Desktop and try again.
Launching Xcode
If nothing happens,download Xcode and try again.
Launching Visual Studio
If nothing happens,download the GitHub extension for Visual Studio and try again.
Latest commit
This should also fix the `microsoft.scalar-release` pipeline.
Git stats
Files
PermalinkReadme.md
What is Scalar?
Scalar is an opinionated repository management tool. By creating newrepositories or registering existing repositories with Scalar, your Gitexperience will speed up. Scalar sets advanced Git config settings,maintains your repositories in the background, and helps reduce data sentacross the network.
You can learn more about Scalar in this video:Git at Scale for Everyone.
Table of Contents
Getting Started
Full details can be found inour documentation page.
Installing on macOS
Scalar is installed and updated on macOS viaHomebrew.
brew tap microsoft/gitbrew install --cask scalar
If you wish to use theGVFS Protocol, then you willinstead need the cask that usesour custom fork of Git:
brew tap microsoft/gitbrew install --cask scalar-azrepos
When new versions of Scalar are available, you can upgrade in a fewdifferent ways. First, you can usebrew:
brew update# Use only one of the following, depending on which you have installed:brew upgrade --cask scalarbrew upgrade --cask scalar-azreposAlternatively, you can runscalar upgrade and it will run the necessarybrew commands on your behalf.
If your repository has many files in the working directory, then you mightwant to installWatchman, whichScalar will detect and configure with Git's File System Monitor feature.
brew install watchman
Installing on Windows
To install Scalar on Windows, downloadInstallers_Windows_Release.zipfrom thelatest releaseand extract all of the files. Run the contained installers for Git andScalar, with names matching these patterns:
Git\Git-2.XX.Y-vfs.*.*-64-bit.exeScalar\SetupScalar.YY.MM.<sprint>.<minor>.exe
Note: we are investigating package management tools to have the Windowsinstall process be as simple as thebrew process on macOS. See#433 for progress onthis feature.
Installing on Linux
Currently, we package a custom version of Git and Scalar as.deb packagesthat can be installed after downloading from the GitHub releases pages.In order to get background maintenance as part ofscalar clone orscalar register, you need to be running Git 2.30.0 or higher.Alternatively, you can install our custom version of Git.(The custom Git version is also required if you want GVFS protocol supporton Azure Repos.)
The latest releases can be downloaded and installed as follows:
Note: If you don't have
wget, then trysudo apt-get install wgetfirst.
# (Optional if running Git 2.30.0 or above)# Install git-vfs, a custom fork of Gitwget https://github.com/microsoft/git/releases/download/v2.29.0.vfs.0.0/git-vfs_2.29.0.vfs.0.0.debsudo dpkg -i git-vfs_2.29.0.vfs.0.0.deb# Install GCM Corewget https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.252-beta/gcmcore-linux_amd64.2.0.252.766.debsudo dpkg -i gcmcore-linux_amd64.2.0.252.766.debgit-credential-manager-core configure# Install Scalarwget https://github.com/microsoft/scalar/releases/download/v20.10.178.6/scalar-azrepos-linux_amd64.20.10.178.0.debsudo dpkg -i scalar-azrepos-linux_amd64.20.10.178.0.deb# Test installationgit versiongit-credential-manager-core versionscalar version
We are working to provide a package viaapt-get to make this installationeasier and better for automatically upgrading.
The current installation via.deb package only works on Debian-basedLinux distributions. The software has only been compiled and tested with x86_64/amd64architectures. Motivated users can installmicrosoft/gitand Scalar from source. SeetheInstallFromSource.sh scriptfor assistance installing Scalar from source.
Basic Scalar Use
To create a new local repository from a remote repository, run
scalar clone [--full-clone]<url> [<dir>]
If the given<url> is hosted by Azure Repos, then the clone will usethe GVFS Protocolto reduce the amount of data sent across the network. Otherwise, this willattempt to useGit's partial clone featureto achieve similar results.
If you already have a local Git repository and do not want to clone a newone, you can get many of the benefits of Scalar by registering your repositoryusing thescalar register command.
scalar register
After either of these commands, your repositories will be initialized withadvanced Git performance features and will be maintained in the backgroundaccording to our recommended maintenance schedule.
Example Workflow
If you want to get a feel for an initial workflow with a test project, hereare some commands that cloneour test repoand initialize the sparse-checkout definition to grow the working directory.
Run these commands in Terminal on macOS or in Git Bash on Windows.
First, clone the repository using the GVFS protocol.
$ scalar clone https://dev.azure.com/gvfs/ci/_git/ForTestsClone parameters: Repo URL: https://dev.azure.com/gvfs/ci/_git/ForTests Branch: Default Cache Server: Default Local Cache: C:\.scalarCache Destination: C:\_git\ForTests FullClone: FalseAuthenticating...Querying remotefor config...Using cache server: None (https://dev.azure.com/gvfs/ci/_git/ForTests)Cloning...Fetching commits and trees from origin (no cache server)...Configuring Watchman...Validating repo...Complete!
Then, navigate into the repository'ssrc directory.(Related:Why doesscalar clone create asrc folder?)
$cd ForTests/src$ ls -a./ .git/ .gitignore GvFlt_EULA.md License.md Protocol.md Settings.StyleCop../ .gitattributes AuthoringTests.md GVFS.sln nuget.config Readme.mdThis directory is theworking directory, which contains all filestracked by Git. It also includes the.git directory and its contents.
The working directory does not contain any subdirectories (other than the.git directory). This is due to the initial sparse-checkout definitionwhich only cares about the files at root. We can expand the sparse-checkoutusing thegit sparse-checkout set andgit sparse-checkout add commands:
$ git sparse-checkoutset GVFS/GVFS.Common GVFS/GVFS.UnitTests GitHooksLoader$ ls -a./ .git/ .gitignore GitHooksLoader/ GVFS/ License.md Protocol.md Settings.StyleCop../ .gitattributes AuthoringTests.md GvFlt_EULA.md GVFS.sln nuget.config Readme.md$ ls GVFSGVFS.Common/ GVFS.UnitTests/ LibGit2Sharp.NativeBinaries.props ProjectedFSLib.NativeBinaries.props$ git sparse-checkout add GVFS/GVFS$ ls GVFSGVFS/ GVFS.Common/ GVFS.UnitTests/ LibGit2Sharp.NativeBinaries.props ProjectedFSLib.NativeBinaries.propsLearn more about sparse-checkout here.
License
The Scalar source code in this repo is available under the MIT license. SeeLicense.md.
Code of Conduct
This project has adopted theMicrosoft Open Source Code of Conduct.For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.
About
Scalar: A set of tools and extensions for Git to allow very large monorepos to run on Git without a virtualization layer


