- Notifications
You must be signed in to change notification settings - Fork101
A fork of Git containing Microsoft-specific patches.
License
microsoft/git
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This ismicrosoft/git
, a special Git distribution to support monorepo scenarios. If you arenotworking in a monorepo, you are likely searching forGit for Windows instead of this codebase.
In addition to the Git command-line interface (CLI),microsoft/git
includes the Scalar CLI tofurther enable working with extremely large repositories. Scalar is a tool to apply the latestrecommendations and use the most advanced Git features. You can readthe Scalar CLI documentation or read ourScalar user guide includingthe philosophy of Scalar.
If you encounter problems withmicrosoft/git
, please report them asGitHub issues.
Git is awesome - it's a fast, scalable, distributed version control system with an unusually richcommand set that provides both high-level operations and full access to internals. What more couldyou ask for?
Well, because Git is a distributed version control system, each Git repository has a copy of allfiles in the entire history. As large repositories, akamonorepos grow, Git can struggle tomanage all that data. As Git commands likestatus
andfetch
get slower, developers stop waitingand start switching context. And context switches harm developer productivity.
microsoft/git
is focused on addressing these performance woes and making the monorepo developerexperience first-class. The Scalar CLI packages all of these recommendations into a simple set ofcommands.
One major feature that Scalar recommends ispartial clone,which reduces the amount of data transferred in order to work with a Git repository. While severalservices such as GitHub support partial clone, Azure Repos instead has an older version of thisfunctionality calledthe GVFS protocol.The integration with the GVFS protocol present inmicrosoft/git
is not appropriate to include inthe core Git client because partial clone is the official version of that functionality.
If you're working in a monorepo and want to take advantage of the performance boosts inmicrosoft/git
, then you can download the latest version installer for your OS from theReleases page. Alternatively, you can opt to installvia the command line, using the below instructions for supported OSes:
Note: Winget is still in public preview, meaning you currentlyneed to take special installation steps:Either manually install the.appxbundle
available at thepreview version of App Installer,or participate in theWindows Insider flight ringsincewinget
is available by default on preview versions of Windows.
To install with Winget, run
winget install --id microsoft.git
Double-check that you have the right version by running these commands,which should have the same output:
git versionscalar version
To upgrademicrosoft/git
, use the following Git command, which will download and install the latestrelease.
git update-microsoft-git
You may also be alerted with a notification to upgrade, which presents a single-click process forrunninggit update-microsoft-git
.
To installmicrosoft/git
on macOS, firstbe sure that Homebrew is installed theninstall themicrosoft-git
cask with these steps:
brew tap microsoft/gitbrew install --cask microsoft-git
Double-check that you have the right version by running these commands,which should have the same output:
git versionscalar version
To upgrade microsoft/git, you can run the necessarybrew
commands:
brew updatebrew upgrade --cask microsoft-git
Or you can run thegit update-microsoft-git
command, which will run those brew commands for you.
On newer distributions*, you can install using the most recent Debian package.To download and validate the signature of this package, run the following:
# Install needed packagessudo apt-get install -y curl debsig-verify# Download public key signature filecurl -s https://api.github.com/repos/microsoft/git/releases/latest \| grep -E'browser_download_url.*msft-git-public.asc' \| cut -d: -f 2,3 \| tr -d\" \| xargs -I'url' curl -L -o msft-git-public.asc'url'# De-armor public key signature filegpg --output msft-git-public.gpg --dearmor msft-git-public.asc# Note that the fingerprint of this key is "B8F12E25441124E1", which you can# determine by running:gpg --show-keys msft-git-public.asc| head -n 2| tail -n 1| tail -c 17# Copy de-armored public key to debsig keyring foldersudo mkdir /usr/share/debsig/keyrings/B8F12E25441124E1sudo mv msft-git-public.gpg /usr/share/debsig/keyrings/B8F12E25441124E1/# Create an appropriate policy filesudo mkdir /etc/debsig/policies/B8F12E25441124E1cat> generic.pol<<EOL<?xml version="1.0"?><!DOCTYPE Policy SYSTEM "https://www.debian.org/debsig/1.0/policy.dtd"><Policy xmlns="https://www.debian.org/debsig/1.0/"> <Origin Name="Microsoft Git" Description="Microsoft Git public key"/> <Selection> <Required Type="origin" File="msft-git-public.gpg"/> </Selection> <Verification MinOptional="0"> <Required Type="origin" File="msft-git-public.gpg"/> </Verification></Policy>EOLsudo mv generic.pol /etc/debsig/policies/B8F12E25441124E1/generic.pol# Download Debian packagecurl -s https://api.github.com/repos/microsoft/git/releases/latest \| grep"browser_download_url.*deb" \| cut -d: -f 2,3 \| tr -d\" \| xargs -I'url' curl -L -o msft-git.deb'url'# Verifydebsig-verify msft-git.deb# Installsudo dpkg -i msft-git.deb
Double-check that you have the right version by running these commands,which should have the same output:
git versionscalar version
To upgrade, you will need to repeat these steps to reinstall.
*Older distributions are missing some required dependencies. Eventhough the package may appear to install successfully,microsoft/ git
will not function as expected. If you are runningUbuntu 20.04
orolder, please follow the install from source instructions belowinstead of installing the debian package.
On older or other distros you will need to compile and installmicrosoft/git
from source:
git clone https://github.com/microsoft/git microsoft-gitcd microsoft-gitmake -j12 prefix=/usr/localsudo make -j12 prefix=/usr/local install
For more assistance building Git from source, seethe INSTALL file in the core Git project.
While the INSTALL file covers dependencies in detail, here is a shortlist of common required dependencies on older Debian/Ubuntu distros:
sudo apt-get updatesudo apt-get install libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc
This project welcomes contributions and suggestions. Most contributions require you to agree to aContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant usthe rights to use your contribution. For details, visithttps://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to providea CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructionsprovided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted theMicrosoft Open Source Code of Conduct.For more information see theCode of Conduct FAQ orcontactopencode@microsoft.com with any additional questions or comments.
About
A fork of Git containing Microsoft-specific patches.
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- C51.7%
- Shell36.6%
- Perl4.6%
- Tcl3.6%
- Python0.8%
- Makefile0.7%
- Other2.0%