Skip to content

Commit a98f46a

Browse files
derrickstoleeldennington
authored andcommitted
Merge pull request microsoft#333: update microsoft/git README
Signed-off-by: Derrick Stolee <[email protected]>
2 parents 50ac8bc + 2e7bbcd commit a98f46a

File tree

1 file changed

+189
-137
lines changed

1 file changed

+189
-137
lines changed

README.md

Lines changed: 189 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,191 @@
1-
Git for Windows
2-
===============
3-
4-
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/git-for-windows/git)
5-
[![Build status](https://github.com/git-for-windows/git/workflows/CI/badge.svg)](https://github.com/git-for-windows/git/actions?query=branch%3Amain+event%3Apush)
6-
[![Join the chat at https://gitter.im/git-for-windows/git](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/git-for-windows/git?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7-
8-
This is [Git for Windows](http://git-for-windows.github.io/), the Windows port
9-
of [Git](http://git-scm.com/).
10-
11-
The Git for Windows project is run using a [governance
12-
model](http://git-for-windows.github.io/governance-model.html). If you
13-
encounter problems, you can report them as [GitHub
14-
issues](https://github.com/git-for-windows/git/issues), discuss them on Git
15-
for Windows' [Google Group](http://groups.google.com/group/git-for-windows),
16-
and [contribute bug
17-
fixes](https://github.com/git-for-windows/git/wiki/How-to-participate).
18-
19-
To build Git for Windows, please either install [Git for Windows'
20-
SDK](https://gitforwindows.org/#download-sdk), start its `git-bash.exe`, `cd`
21-
to your Git worktree and run `make`, or open the Git worktree as a folder in
22-
Visual Studio.
23-
24-
To verify that your build works, use one of the following methods:
25-
26-
- If you want to test the built executables within Git for Windows' SDK,
27-
prepend `<worktree>/bin-wrappers` to the `PATH`.
28-
- Alternatively, run `make install` in the Git worktree.
29-
- If you need to test this in a full installer, run `sdk build
30-
git-and-installer`.
31-
- You can also "install" Git into an existing portable Git via `make install
32-
DESTDIR=<dir>` where `<dir>` refers to the top-level directory of the
33-
portable Git. In this instance, you will want to prepend that portable Git's
34-
`/cmd` directory to the `PATH`, or test by running that portable Git's
35-
`git-bash.exe` or `git-cmd.exe`.
36-
- If you built using a recent Visual Studio, you can use the menu item
37-
`Build>Install git` (you will want to click on `Project>CMake Settings for
38-
Git` first, then click on `Edit JSON` and then point `installRoot` to the
39-
`mingw64` directory of an already-unpacked portable Git).
40-
41-
As in the previous bullet point, you will then prepend `/cmd` to the `PATH`
42-
or run using the portable Git's `git-bash.exe` or `git-cmd.exe`.
43-
- If you want to run the built executables in-place, but in a CMD instead of
44-
inside a Bash, you can run a snippet like this in the `git-bash.exe` window
45-
where Git was built (ensure that the `EOF` line has no leading spaces), and
46-
then paste into the CMD window what was put in the clipboard:
47-
48-
```sh
49-
clip.exe <<EOF
50-
set GIT_EXEC_PATH=$(cygpath -aw .)
51-
set PATH=$(cygpath -awp ".:contrib/scalar:/mingw64/bin:/usr/bin:$PATH")
52-
set GIT_TEMPLATE_DIR=$(cygpath -aw templates/blt)
53-
set GITPERLLIB=$(cygpath -aw perl/build/lib)
54-
EOF
55-
```
56-
- If you want to run the built executables in-place, but outside of Git for
57-
Windows' SDK, and without an option to set/override any environment
58-
variables (e.g. in Visual Studio's debugger), you can call the Git executable
59-
by its absolute path and use the `--exec-path` option, like so:
60-
61-
```cmd
62-
C:\git-sdk-64\usr\src\git\git.exe --exec-path=C:\git-sdk-64\usr\src\git help
63-
```
64-
65-
Note: for this to work, you have to hard-link (or copy) the `.dll` files from
66-
the `/mingw64/bin` directory to the Git worktree, or add the `/mingw64/bin`
67-
directory to the `PATH` somehow or other.
68-
69-
To make sure that you are testing the correct binary, call `./git.exe version`
70-
in the Git worktree, and then call `git version` in a directory/window where
71-
you want to test Git, and verify that they refer to the same version (you may
72-
even want to pass the command-line option `--build-options` to look at the
73-
exact commit from which the Git version was built).
74-
75-
Git - fast, scalable, distributed revision control system
1+
`microsoft/git` and the Scalar CLI
2+
==================================
3+
4+
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/microsoft/git)
5+
[![Build status](https://github.com/microsoft/git/workflows/CI/badge.svg)](https://github.com/microsoft/git/actions/workflows/main.yml)
6+
7+
This is `microsoft/git`, a special Git distribution to support monorepo scenarios. If you are _not_
8+
working in a monorepo, you are likely searching for
9+
[Git for Windows](http://git-for-windows.github.io/) instead of this codebase.
10+
11+
In addition to the Git command-line interface (CLI), `microsoft/git` includes the Scalar CLI to
12+
further enable working with extremely large repositories. Scalar is a tool to apply the latest
13+
recommendations and use the most advanced Git features. You can read
14+
[the Scalar CLI documentation](contrib/scalar/scalar.txt) or read our
15+
[Scalar user guide](contrib/scalar/docs/index.md) including
16+
[the philosophy of Scalar](contrib/scalar/docs/philosophy.md).
17+
18+
If you encounter problems with `microsoft/git`, please report them as
19+
[GitHub issues](https://github.com/microsoft/git/issues).
20+
21+
Why is this fork needed?
22+
=========================================================
23+
24+
Git is awesome - it's a fast, scalable, distributed version control system with an unusually rich
25+
command set that provides both high-level operations and full access to internals. What more could
26+
you ask for?
27+
28+
Well, because Git is a distributed version control system, each Git repository has a copy of all
29+
files in the entire history. As large repositories, aka _monorepos_ grow, Git can struggle to
30+
manage all that data. As Git commands like `status` and `fetch` get slower, developers stop waiting
31+
and start switching context. And context switches harm developer productivity.
32+
33+
`microsoft/git` is focused on addressing these performance woes and making the monorepo developer
34+
experience first-class. The Scalar CLI packages all of these recommendations into a simple set of
35+
commands.
36+
37+
One major feature that Scalar recommends is [partial clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/),
38+
which reduces the amount of data transferred in order to work with a Git repository. While several
39+
services such as GitHub support partial clone, Azure Repos instead has an older version of this
40+
functionality called
41+
[the GVFS protocol](https://docs.microsoft.com/en-us/azure/devops/learn/git/gvfs-architecture#gvfs-protocol).
42+
The integration with the GVFS protocol present in `microsoft/git` is not appropriate to include in
43+
the core Git client because partial clone is the official version of that functionality.
44+
45+
Downloading and Installing
46+
=========================================================
47+
48+
If you're working in a monorepo and want to take advantage of the performance boosts in
49+
`microsoft/git`, then you can download the latest version installer for your OS from the
50+
[Releases page](https://github.com/microsoft/git/releases). Alternatively, you can opt to install
51+
via the command line, using the below instructions for supported OSes:
52+
53+
## Windows
54+
55+
__Note:__ Winget is still in public preview, meaning you currently
56+
[need to take special installation steps](https://docs.microsoft.com/en-us/windows/package-manager/winget/#install-winget):
57+
Either manually install the `.appxbundle` available at the
58+
[preview version of App Installer](https://www.microsoft.com/p/app-installer/9nblggh4nns1?ocid=9nblggh4nns1_ORSEARCH_Bing&rtc=1&activetab=pivot:overviewtab),
59+
or participate in the
60+
[Windows Insider flight ring](https://insider.windows.com/https://insider.windows.com/)
61+
since `winget` is available by default on preview versions of Windows.
62+
63+
To install with Winget, run
64+
65+
```shell
66+
winget install --id microsoft.git
67+
```
68+
69+
Double-check that you have the right version by running these commands,
70+
which should have the same output:
71+
72+
```shell
73+
git version
74+
scalar version
75+
```
76+
77+
To upgrade `microsoft/git`, use the following Git command, which will download and install the latest
78+
release.
79+
80+
```shell
81+
git update-microsoft-git
82+
```
83+
84+
You may also be alerted with a notification to upgrade, which presents a single-click process for
85+
running `git update-microsoft-git`.
86+
87+
## macOS
88+
89+
To install `microsoft/git` on macOS, first [be sure that Homebrew is installed](https://brew.sh/) then
90+
install the `microsoft-git` cask with these steps:
91+
92+
```shell
93+
brew tap microsoft/git
94+
brew install --cask microsoft-git
95+
```
96+
97+
Double-check that you have the right version by running these commands,
98+
which should have the same output:
99+
100+
```shell
101+
git version
102+
scalar version
103+
```
104+
105+
To upgrade `microsoft/git`, you can run the necessary `brew` commands:
106+
107+
```shell
108+
brew update
109+
brew upgrade --cask microsoft-git
110+
```
111+
112+
Or you can run the `git update-microsoft-git` command, which will run those
113+
`brew` commands for you.
114+
115+
## Linux
116+
117+
`apt-get` support is available for Ubuntu Hirsute
118+
Hippo (21.04). Take the following steps to set up and install:
119+
120+
```shell
121+
curl -sSL https://packages.microsoft.com/config/ubuntu/21.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list
122+
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
123+
sudo apt-get update
124+
sudo apt-get install microsoft-git
125+
```
126+
127+
To upgrade `microsoft/git`, you can run the necessary `apt-get` commands:
128+
129+
```shell
130+
sudo apt-get update
131+
sudo apt-get upgrade microsoft-git
132+
```
133+
134+
Or you can run the `git update-microsoft-git` command, which will run those
135+
`apt-get` commands for you.
136+
137+
### Other Ubuntu/Debian distributions
138+
139+
On newer distributions*, you may use the most recent
140+
[`.deb` package](https://github.com/microsoft/git/releases). For example,
141+
you can download a specific version as follows:
142+
143+
```shell
144+
wget -O microsoft-git.deb https://github.com/microsoft/git/releases/download/v2.33.0.vfs.0.0/microsoft-git_2.33.0.vfs.0.0.deb
145+
sudo dpkg -i microsoft-git.deb
146+
```
147+
148+
Double-check that you have the right version by running these commands,
149+
which should have the same output:
150+
151+
```shell
152+
git version
153+
scalar version
154+
```
155+
156+
To upgrade, you will need to repeat these steps to reinstall.
157+
158+
*Older distributions are missing some required dependencies. Even
159+
though the package may appear to install successfully, `microsoft/
160+
git` will not function as expected. If you are running Ubuntu 18.04 or
161+
older, please follow the install from source instructions below
162+
instead of installing the debian package.
163+
164+
### Other distributions
165+
166+
You will need to compile and install `microsoft/git` from source:
167+
168+
```shell
169+
git clone https://github.com/microsoft/git microsoft-git
170+
cd microsoft-git
171+
make -j12 prefix=/usr/local INCLUDE_SCALAR=YesPlease
172+
sudo make -j12 prefix=/usr/local INCLUDE_SCALAR=YesPlease install
173+
```
174+
175+
For more assistance building Git from source, see
176+
[the INSTALL file in the core Git project](https://github.com/git/git/blob/master/INSTALL).
177+
178+
Contributing
76179
=========================================================
77180

78-
Git is a fast, scalable, distributed revision control system with an
79-
unusually rich command set that provides both high-level operations
80-
and full access to internals.
81-
82-
Git is an Open Source project covered by the GNU General Public
83-
License version 2 (some parts of it are under different licenses,
84-
compatible with the GPLv2). It was originally written by Linus
85-
Torvalds with help of a group of hackers around the net.
86-
87-
Please read the file [INSTALL][] for installation instructions.
88-
89-
Many Git online resources are accessible from <https://git-scm.com/>
90-
including full documentation and Git related tools.
91-
92-
See [Documentation/gittutorial.txt][] to get started, then see
93-
[Documentation/giteveryday.txt][] for a useful minimum set of commands, and
94-
`Documentation/git-<commandname>.txt` for documentation of each command.
95-
If git has been correctly installed, then the tutorial can also be
96-
read with `man gittutorial` or `git help tutorial`, and the
97-
documentation of each command with `man git-<commandname>` or `git help
98-
<commandname>`.
99-
100-
CVS users may also want to read [Documentation/gitcvs-migration.txt][]
101-
(`man gitcvs-migration` or `git help cvs-migration` if git is
102-
installed).
103-
104-
The user discussion and development of core Git take place on the Git
105-
mailing list -- everyone is welcome to post bug reports, feature
106-
requests, comments and patches to [email protected] (read
107-
[Documentation/SubmittingPatches][] for instructions on patch submission).
108-
To subscribe to the list, send an email with just "subscribe git" in
109-
the body to [email protected]. The mailing list archives are
110-
available at <https://lore.kernel.org/git/>,
111-
<http://marc.info/?l=git> and other archival sites.
112-
The core git mailing list is plain text (no HTML!).
113-
114-
Issues which are security relevant should be disclosed privately to
115-
the Git Security mailing list <[email protected]>.
116-
117-
The maintainer frequently sends the "What's cooking" reports that
118-
list the current status of various development topics to the mailing
119-
list. The discussion following them give a good reference for
120-
project status, development direction and remaining tasks.
121-
122-
The name "git" was given by Linus Torvalds when he wrote the very
123-
first version. He described the tool as "the stupid content tracker"
124-
and the name as (depending on your mood):
125-
126-
- random three-letter combination that is pronounceable, and not
127-
actually used by any common UNIX command. The fact that it is a
128-
mispronunciation of "get" may or may not be relevant.
129-
- stupid. contemptible and despicable. simple. Take your pick from the
130-
dictionary of slang.
131-
- "global information tracker": you're in a good mood, and it actually
132-
works for you. Angels sing, and a light suddenly fills the room.
133-
- "goddamn idiotic truckload of sh*t": when it breaks
134-
135-
[INSTALL]: INSTALL
136-
[Documentation/gittutorial.txt]: Documentation/gittutorial.txt
137-
[Documentation/giteveryday.txt]: Documentation/giteveryday.txt
138-
[Documentation/gitcvs-migration.txt]: Documentation/gitcvs-migration.txt
139-
[Documentation/SubmittingPatches]: Documentation/SubmittingPatches
181+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
182+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
183+
the rights to use your contribution. For details, visit <https://cla.microsoft.com.>
184+
185+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
186+
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
187+
provided by the bot. You will only need to do this once across all repos using our CLA.
188+
189+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
190+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
191+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

0 commit comments

Comments
 (0)