Merge pull request #333: update microsoft/git README

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
This commit is contained in:
Derrick Stolee 2021-05-17 11:11:38 -04:00 коммит произвёл Derrick Stolee
Родитель 670cb1d170 d8fc5bee2b
Коммит 7bf2503773
3 изменённых файлов: 178 добавлений и 162 удалений

42
.github/ISSUE_TEMPLATE.md поставляемый
Просмотреть файл

@ -1,12 +1,26 @@
- [ ] I was not able to find an [open](https://github.com/git-for-windows/git/issues?q=is%3Aopen) or [closed](https://github.com/git-for-windows/git/issues?q=is%3Aclosed) issue matching what I'm seeing - [ ] I was not able to find an [open](https://github.com/microsoft/git/issues?q=is%3Aopen)
or [closed](https://github.com/microsoft/git/issues?q=is%3Aclosed) issue matching
what I'm seeing, including in [the `git-for-windows/git` tracker](https://github.com/git-for-windows/git/issues).
### Setup ### Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit? - Which version of `microsoft/git` are you using? Is it 32-bit or 64-bit?
``` ```
$ git --version --build-options $ git --version --build-options
** insert your machine's response here **
```
Are you using Scalar or VFS for Git?
** insert your answer here **
If VFS for Git, then what version?
```
$ gvfs version
** insert your machine's response here ** ** insert your machine's response here **
``` ```
@ -15,20 +29,6 @@ $ git --version --build-options
``` ```
$ cmd.exe /c ver $ cmd.exe /c ver
** insert your machine's response here **
```
- What options did you set as part of the installation? Or did you choose the
defaults?
```
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
** insert your machine's response here ** ** insert your machine's response here **
``` ```
@ -58,7 +58,11 @@ $ cat /etc/install-options.txt
** insert here ** ** insert here **
- If the problem was occurring with a specific repository, can you provide the - If the problem was occurring with a specific repository, can you specify
URL to that repository to help us with testing? the repository?
** insert URL here ** * [ ] Public repo: **insert URL here**
* [ ] Windows monorepo
* [ ] Office monorepo
* [ ] Other Microsoft-internal repo: **insert name here**
* [ ] Other internal repo.

23
.github/PULL_REQUEST_TEMPLATE.md поставляемый
Просмотреть файл

@ -1,19 +1,10 @@
Thanks for taking the time to contribute to Git! Thanks for taking the time to contribute to Git!
Those seeking to contribute to the Git for Windows fork should see This fork contains changes specific to monorepo scenarios. If you are an
http://gitforwindows.org/#contribute on how to contribute Windows specific external contributor, then please detail your reason for submitting to
enhancements. this fork:
If your contribution is for the core Git functions and documentation * [ ] This is an early version of work already under review upstream.
please be aware that the Git community does not use the github.com issues * [ ] This change only applies to interactions with Azure DevOps and the
or pull request mechanism for their contributions. GVFS Protocol.
* [ ] This change only applies to the virtualization hook and VFS for Git.
Instead, we use the Git mailing list (git@vger.kernel.org) for code and
documentation submissions, code reviews, and bug reports. The
mailing list is plain text only (anything with HTML is sent directly
to the spam folder).
Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.
Please read the "guidelines for contributing" linked above!

275
README.md
Просмотреть файл

@ -1,147 +1,168 @@
Git for Windows `microsoft/git` and the Scalar CLI
=============== ==================================
[![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc)](https://open.vscode.dev/git-for-windows/git) [![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/microsoft/git)
[![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) [![Build status](https://github.com/microsoft/git/workflows/CI/badge.svg)](https://github.com/microsoft/git/actions/workflows/main.yml)
[![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)
This is [Git for Windows](http://git-for-windows.github.io/), the Windows port This is `microsoft/git`, a special Git distribution to support monorepo scenarios. If you are _not_
of [Git](http://git-scm.com/). working in a monorepo, you are likely searching for
[Git for Windows](https://git-for-windows.github.io/) instead of this codebase.
The Git for Windows project is run using a [governance In addition to the Git command-line interface (CLI), `microsoft/git` includes the Scalar CLI to
model](http://git-for-windows.github.io/governance-model.html). If you further enable working with extremely large repositories. Scalar is a tool to apply the latest
encounter problems, you can report them as [GitHub recommendations and use the most advanced Git features. You can read
issues](https://github.com/git-for-windows/git/issues), discuss them on Git [the Scalar CLI documentation](Documentation/scalar.txt) or read our
for Windows' [Google Group](http://groups.google.com/group/git-for-windows), [Scalar user guide](contrib/scalar/docs/index.md) including
and [contribute bug [the philosophy of Scalar](contrib/scalar/docs/philosophy.md).
fixes](https://github.com/git-for-windows/git/wiki/How-to-participate).
To build Git for Windows, please either install [Git for Windows' If you encounter problems with `microsoft/git`, please report them as
SDK](https://gitforwindows.org/#download-sdk), start its `git-bash.exe`, `cd` [GitHub issues](https://github.com/microsoft/git/issues).
to your Git worktree and run `make`, or open the Git worktree as a folder in
Visual Studio.
To verify that your build works, use one of the following methods: Why is this fork needed?
- If you want to test the built executables within Git for Windows' SDK,
prepend `<worktree>/bin-wrappers` to the `PATH`.
- Alternatively, run `make install` in the Git worktree.
- If you need to test this in a full installer, run `sdk build
git-and-installer`.
- You can also "install" Git into an existing portable Git via `make install
DESTDIR=<dir>` where `<dir>` refers to the top-level directory of the
portable Git. In this instance, you will want to prepend that portable Git's
`/cmd` directory to the `PATH`, or test by running that portable Git's
`git-bash.exe` or `git-cmd.exe`.
- If you built using a recent Visual Studio, you can use the menu item
`Build>Install git` (you will want to click on `Project>CMake Settings for
Git` first, then click on `Edit JSON` and then point `installRoot` to the
`mingw64` directory of an already-unpacked portable Git).
As in the previous bullet point, you will then prepend `/cmd` to the `PATH`
or run using the portable Git's `git-bash.exe` or `git-cmd.exe`.
- If you want to run the built executables in-place, but in a CMD instead of
inside a Bash, you can run a snippet like this in the `git-bash.exe` window
where Git was built (ensure that the `EOF` line has no leading spaces), and
then paste into the CMD window what was put in the clipboard:
```sh
clip.exe <<EOF
set GIT_EXEC_PATH=$(cygpath -aw .)
set PATH=$(cygpath -awp ".:contrib/scalar:/mingw64/bin:/usr/bin:$PATH")
set GIT_TEMPLATE_DIR=$(cygpath -aw templates/blt)
set GITPERLLIB=$(cygpath -aw perl/build/lib)
EOF
```
- If you want to run the built executables in-place, but outside of Git for
Windows' SDK, and without an option to set/override any environment
variables (e.g. in Visual Studio's debugger), you can call the Git executable
by its absolute path and use the `--exec-path` option, like so:
```cmd
C:\git-sdk-64\usr\src\git\git.exe --exec-path=C:\git-sdk-64\usr\src\git help
```
Note: for this to work, you have to hard-link (or copy) the `.dll` files from
the `/mingw64/bin` directory to the Git worktree, or add the `/mingw64/bin`
directory to the `PATH` somehow or other.
To make sure that you are testing the correct binary, call `./git.exe version`
in the Git worktree, and then call `git version` in a directory/window where
you want to test Git, and verify that they refer to the same version (you may
even want to pass the command-line option `--build-options` to look at the
exact commit from which the Git version was built).
Git - fast, scalable, distributed revision control system
========================================================= =========================================================
Git is a fast, scalable, distributed revision control system with an Git is awesome - it's a fast, scalable, distributed version control system with an unusually rich
unusually rich command set that provides both high-level operations command set that provides both high-level operations and full access to internals. What more could
and full access to internals. you ask for?
Git is an Open Source project covered by the GNU General Public Well, because Git is a distributed version control system, each Git repository has a copy of all
License version 2 (some parts of it are under different licenses, files in the entire history. As large repositories, aka _monorepos_ grow, Git can struggle to
compatible with the GPLv2). It was originally written by Linus manage all that data. As Git commands like `status` and `fetch` get slower, developers stop waiting
Torvalds with help of a group of hackers around the net. and start switching context. And context switches harm developer productivity.
Please read the file [INSTALL][] for installation instructions. `microsoft/git` is focused on addressing these performance woes and making the monorepo developer
experience first-class. The Scalar CLI packages all of these recommendations into a simple set of
commands.
Many Git online resources are accessible from <https://git-scm.com/> 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/),
including full documentation and Git related tools. which reduces the amount of data transferred in order to work with a Git repository. While several
services such as GitHub support partial clone, Azure Repos instead has an older version of this
functionality called
[the GVFS protocol](https://docs.microsoft.com/en-us/azure/devops/learn/git/gvfs-architecture#gvfs-protocol).
The integration with the GVFS protocol present in `microsoft/git` is not appropriate to include in
the core Git client because partial clone is the official version of that functionality.
See [Documentation/gittutorial.txt][] to get started, then see Downloading and Installing
[Documentation/giteveryday.txt][] for a useful minimum set of commands, and =========================================================
`Documentation/git-<commandname>.txt` for documentation of each command.
If git has been correctly installed, then the tutorial can also be
read with `man gittutorial` or `git help tutorial`, and the
documentation of each command with `man git-<commandname>` or `git help
<commandname>`.
CVS users may also want to read [Documentation/gitcvs-migration.txt][] If you're working in a monorepo and want to take advantage of the performance boosts in
(`man gitcvs-migration` or `git help cvs-migration` if git is `microsoft/git`, then you can download the latest version installer for your OS from the
installed). [Releases page](https://github.com/microsoft/git/releases). Alternatively, you can opt to install
via the command line, using the below instructions for supported OSes:
The user discussion and development of core Git take place on the Git ## Windows
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org (read
[Documentation/SubmittingPatches][] for instructions on patch submission
and [Documentation/CodingGuidelines][]).
Those wishing to help with error message, usage and informational message __Note:__ Winget is still in public preview, meaning you currently
string translations (localization l10) should see [po/README.md][] [need to take special installation steps](https://docs.microsoft.com/en-us/windows/package-manager/winget/#install-winget):
(a `po` file is a Portable Object file that holds the translations). Either manually install the `.appxbundle` available at the
[preview version of App Installer](https://www.microsoft.com/p/app-installer/9nblggh4nns1?ocid=9nblggh4nns1_ORSEARCH_Bing&rtc=1&activetab=pivot:overviewtab),
or participate in the
[Windows Insider flight ring](https://insider.windows.com/https://insider.windows.com/)
since `winget` is available by default on preview versions of Windows.
To subscribe to the list, send an email with just "subscribe git" in To install with Winget, run
the body to majordomo@vger.kernel.org (not the Git list). The mailing
list archives are available at <https://lore.kernel.org/git/>,
<http://marc.info/?l=git> and other archival sites.
The core git mailing list is plain text (no HTML!).
Issues which are security relevant should be disclosed privately to ```shell
the Git Security mailing list <git-security@googlegroups.com>. winget install --id microsoft.git
```
The maintainer frequently sends the "What's cooking" reports that Double-check that you have the right version by running these commands,
list the current status of various development topics to the mailing which should have the same output:
list. The discussion following them give a good reference for
project status, development direction and remaining tasks.
The name "git" was given by Linus Torvalds when he wrote the very ```shell
first version. He described the tool as "the stupid content tracker" git version
and the name as (depending on your mood): scalar version
```
- random three-letter combination that is pronounceable, and not To upgrade `microsoft/git`, use the following Git command, which will download and install the latest
actually used by any common UNIX command. The fact that it is a release.
mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the
dictionary of slang.
- "global information tracker": you're in a good mood, and it actually
works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks
[INSTALL]: INSTALL ```shell
[Documentation/gittutorial.txt]: Documentation/gittutorial.txt git update-microsoft-git
[Documentation/giteveryday.txt]: Documentation/giteveryday.txt ```
[Documentation/gitcvs-migration.txt]: Documentation/gitcvs-migration.txt
[Documentation/SubmittingPatches]: Documentation/SubmittingPatches You may also be alerted with a notification to upgrade, which presents a single-click process for
[Documentation/CodingGuidelines]: Documentation/CodingGuidelines running `git update-microsoft-git`.
[po/README.md]: po/README.md
## macOS
To install `microsoft/git` on macOS, first [be sure that Homebrew is installed](https://brew.sh/) then
install the `microsoft-git` cask with these steps:
```shell
brew tap microsoft/git
brew install --cask microsoft-git
```
Double-check that you have the right version by running these commands,
which should have the same output:
```shell
git version
scalar version
```
To upgrade microsoft/git, you can run the necessary `brew` commands:
```shell
brew update
brew upgrade --cask microsoft-git
```
Or you can run the `git update-microsoft-git` command, which will run those brew commands for you.
## Linux
### Ubuntu/Debian distributions
On newer distributions*, you can download the most recent Debian package from
the [releases page](https://github.com/microsoft/git/releases/latest) (or
using a tool such as `wget`) then run:
```shell
sudo dpkg -i <path to package>
```
Double-check that you have the right version by running these commands,
which should have the same output:
```shell
git version
scalar version
```
To upgrade, you will need to repeat these steps to reinstall.
*Older distributions are missing some required dependencies. Even
though the package may appear to install successfully, `microsoft/
git` will not function as expected. If you are running Ubuntu 18.04 or
older, please follow the install from source instructions below
instead of installing the debian package.
### Other distributions
You will need to compile and install `microsoft/git` from source:
```shell
git clone https://github.com/microsoft/git microsoft-git
cd microsoft-git
make -j12 prefix=/usr/local
sudo make -j12 prefix=/usr/local install
```
For more assistance building Git from source, see
[the INSTALL file in the core Git project](https://github.com/git/git/blob/master/INSTALL).
Contributing
=========================================================
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit <https://cla.microsoft.com>.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.