зеркало из https://github.com/microsoft/git.git
Merge 'readme' into HEAD
Add a README.md for GitHub goodness. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Коммит
aef8580272
|
@ -0,0 +1,64 @@
|
|||
- [ ] 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
|
||||
|
||||
### Setup
|
||||
|
||||
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
|
||||
|
||||
```
|
||||
$ git --version --build-options
|
||||
|
||||
** insert your machine's response here **
|
||||
```
|
||||
|
||||
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
|
||||
|
||||
```
|
||||
$ 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 **
|
||||
```
|
||||
|
||||
- Any other interesting things about your environment that might be related
|
||||
to the issue you're seeing?
|
||||
|
||||
** insert your response here **
|
||||
|
||||
### Details
|
||||
|
||||
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
|
||||
|
||||
** insert your response here **
|
||||
|
||||
- What commands did you run to trigger this issue? If you can provide a
|
||||
[Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
|
||||
this will help us understand the issue.
|
||||
|
||||
```
|
||||
** insert your commands here **
|
||||
```
|
||||
- What did you expect to occur after running these commands?
|
||||
|
||||
** insert here **
|
||||
|
||||
- What actually happened instead?
|
||||
|
||||
** insert here **
|
||||
|
||||
- If the problem was occurring with a specific repository, can you provide the
|
||||
URL to that repository to help us with testing?
|
||||
|
||||
** insert URL here **
|
|
@ -1,7 +1,19 @@
|
|||
Thanks for taking the time to contribute to Git! Please be advised that the
|
||||
Git community does not use github.com for their contributions. Instead, we use
|
||||
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
|
||||
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
|
||||
Thanks for taking the time to contribute to Git!
|
||||
|
||||
Those seeking to contribute to the Git for Windows fork should see
|
||||
http://gitforwindows.org/#contribute on how to contribute Windows specific
|
||||
enhancements.
|
||||
|
||||
If your contribution is for the core Git functions and documentation
|
||||
please be aware that the Git community does not use the github.com issues
|
||||
or pull request mechanism for their contributions.
|
||||
|
||||
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!
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
|
||||
|
||||
# *Required* toxicity threshold between 0 and .99 with the higher numbers being
|
||||
# the most toxic. Anything higher than this threshold will be marked as toxic
|
||||
# and commented on
|
||||
sentimentBotToxicityThreshold: .7
|
||||
|
||||
# *Required* Comment to reply with
|
||||
sentimentBotReplyComment: >
|
||||
Please be sure to review the code of conduct and be respectful of other users. cc/ @git-for-windows/trusted-git-for-windows-developers
|
|
@ -1,9 +1,9 @@
|
|||
# Git Code of Conduct
|
||||
# Git for Windows Code of Conduct
|
||||
|
||||
This code of conduct outlines our expectations for participants within
|
||||
the Git community, as well as steps for reporting unacceptable behavior.
|
||||
We are committed to providing a welcoming and inspiring community for
|
||||
all and expect our code of conduct to be honored. Anyone who violates
|
||||
the **Git for Windows** community, as well as steps for reporting unacceptable
|
||||
behavior. We are committed to providing a welcoming and inspiring community
|
||||
for all and expect our code of conduct to be honored. Anyone who violates
|
||||
this code of conduct may be banned from the community.
|
||||
|
||||
## Our Pledge
|
||||
|
@ -65,8 +65,8 @@ representative at an online or offline event.
|
|||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
git@sfconservancy.org, or individually:
|
||||
reported by contacting the Git for Windows maintainer or the community leaders
|
||||
responsible for enforcement at git@sfconservancy.org, or individually:
|
||||
|
||||
- Ævar Arnfjörð Bjarmason <avarab@gmail.com>
|
||||
- Christian Couder <christian.couder@gmail.com>
|
||||
|
|
|
@ -0,0 +1,417 @@
|
|||
How to Contribute to Git for Windows
|
||||
====================================
|
||||
|
||||
Git was originally designed for Unix systems and still today, all the build tools for the Git
|
||||
codebase assume you have standard Unix tools available in your path. If you have an open-source
|
||||
mindset and want to start contributing to Git, but primarily use a Windows machine, then you may
|
||||
have trouble getting started. This guide is for you.
|
||||
|
||||
Get the Source
|
||||
--------------
|
||||
|
||||
Clone the [GitForWindows repository on GitHub](https://github.com/git-for-windows/git).
|
||||
It is helpful to create your own fork for storing your development branches.
|
||||
|
||||
Windows uses different line endings than Unix systems. See
|
||||
[this GitHub article on working with line endings](https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings)
|
||||
if you have trouble with line endings.
|
||||
|
||||
Build the Source
|
||||
----------------
|
||||
|
||||
First, download and install the latest [Git for Windows SDK (64-bit)](https://github.com/git-for-windows/build-extra/releases/latest).
|
||||
When complete, you can run the Git SDK, which creates a new Git Bash terminal window with
|
||||
the additional development commands, such as `make`.
|
||||
|
||||
As of time of writing, the SDK uses a different credential manager, so you may still want to use normal Git
|
||||
Bash for interacting with your remotes. Alternatively, use SSH rather than HTTPS and
|
||||
avoid credential manager problems.
|
||||
|
||||
You should now be ready to type `make` from the root of your `git` source directory.
|
||||
Here are some helpful variations:
|
||||
|
||||
* `make -j[N] DEVELOPER=1`: Compile new sources using up to N concurrent processes.
|
||||
The `DEVELOPER` flag turns on all warnings; code failing these warnings will not be
|
||||
accepted upstream ("upstream" = "the core Git project").
|
||||
* `make clean`: Delete all compiled files.
|
||||
|
||||
When running `make`, you can use `-j$(nproc)` to automatically use the number of processors
|
||||
on your machine as the number of concurrent build processes.
|
||||
|
||||
You can go deeper on the Windows-specific build process by reading the
|
||||
[technical overview](https://github.com/git-for-windows/git/wiki/Technical-overview) or the
|
||||
[guide to compiling Git with Visual Studio](https://github.com/git-for-windows/git/wiki/Compiling-Git-with-Visual-Studio).
|
||||
|
||||
## Building `git` on Windows with Visual Studio
|
||||
|
||||
The typical approach to building `git` is to use the standard `Makefile` with GCC, as
|
||||
above. Developers working in a Windows environment may want to instead build with the
|
||||
[Microsoft Visual C++ compiler and libraries toolset (MSVC)](https://blogs.msdn.microsoft.com/vcblog/2017/03/07/msvc-the-best-choice-for-windows/).
|
||||
There are a few benefits to using MSVC over GCC during your development, including creating
|
||||
symbols for debugging and [performance tracing](https://github.com/Microsoft/perfview#perfview-overview).
|
||||
|
||||
There are two ways to build Git for Windows using MSVC. Each have their own merits.
|
||||
|
||||
### Using SDK Command Line
|
||||
|
||||
Use one of the following commands from the SDK Bash window to build Git for Windows:
|
||||
|
||||
```
|
||||
make MSVC=1 -j12
|
||||
make MSVC=1 DEBUG=1 -j12
|
||||
```
|
||||
|
||||
The first form produces release-mode binaries; the second produces debug-mode binaries.
|
||||
Both forms produce PDB files and can be debugged. However, the first is best for perf
|
||||
tracing and the second is best for single-stepping.
|
||||
|
||||
You can then open Visual Studio and select File -> Open -> Project/Solution and select
|
||||
the compiled `git.exe` file. This creates a basic solution and you can use the debugging
|
||||
and performance tracing tools in Visual Studio to monitor a Git process. Use the Debug
|
||||
Properties page to set the working directory and command line arguments.
|
||||
|
||||
Be sure to clean up before switching back to GCC (or to switch between debug and
|
||||
release MSVC builds):
|
||||
|
||||
```
|
||||
make MSVC=1 -j12 clean
|
||||
make MSVC=1 DEBUG=1 -j12 clean
|
||||
```
|
||||
|
||||
### Using the IDE
|
||||
|
||||
If you prefer working in Visual Studio with a solution full of projects, then you can use
|
||||
CMake, either by letting Visual Studio configure it automatically (simply open Git's
|
||||
top-level directory via `File>Open>Folder...`) or by (downloading and) running
|
||||
[CMake](https://cmake.org) manually.
|
||||
|
||||
What to Change?
|
||||
---------------
|
||||
|
||||
Many new contributors ask: What should I start working on?
|
||||
|
||||
One way to win big with the open-source community is to look at the
|
||||
[issues page](https://github.com/git-for-windows/git/issues) and see if there are any issues that
|
||||
you can fix quickly, or if anything catches your eye.
|
||||
|
||||
You can also look at [the unofficial Chromium issues page](https://crbug.com/git) for
|
||||
multi-platform issues. You can look at recent user questions on
|
||||
[the Git mailing list](https://public-inbox.org/git).
|
||||
|
||||
Or you can "scratch your own itch", i.e. address an issue you have with Git. The team at Microsoft where the Git for Windows maintainer works, for example, is focused almost entirely on [improving performance](https://blogs.msdn.microsoft.com/devops/2018/01/11/microsofts-performance-contributions-to-git-in-2017/).
|
||||
We approach our work by finding something that is slow and try to speed it up. We start our
|
||||
investigation by reliably reproducing the slow behavior, then running that example using
|
||||
the MSVC build and tracing the results in PerfView.
|
||||
|
||||
You could also think of something you wish Git could do, and make it do that thing! The
|
||||
only concern I would have with this approach is whether or not that feature is something
|
||||
the community also wants. If this excites you though, go for it! Don't be afraid to
|
||||
[get involved in the mailing list](http://vger.kernel.org/vger-lists.html#git) early for
|
||||
feedback on the idea.
|
||||
|
||||
Test Your Changes
|
||||
-----------------
|
||||
|
||||
After you make your changes, it is important that you test your changes. Manual testing is
|
||||
important, but checking and extending the existing test suite is even more important. You
|
||||
want to run the functional tests to see if you broke something else during your change, and
|
||||
you want to extend the functional tests to be sure no one breaks your feature in the future.
|
||||
|
||||
### Functional Tests
|
||||
|
||||
Navigate to the `t/` directory and type `make` to run all tests or use `prove` as
|
||||
[described in the Git for Windows wiki](https://github.com/git-for-windows/git/wiki/Building-Git):
|
||||
|
||||
```
|
||||
prove -j12 --state=failed,save ./t[0-9]*.sh
|
||||
```
|
||||
|
||||
You can also run each test directly by running the corresponding shell script with a name
|
||||
like `tNNNN-descriptor.sh`.
|
||||
|
||||
If you are adding new functionality, you may need to create unit tests by creating
|
||||
helper commands that test a very limited action. These commands are stored in `t/helpers`.
|
||||
When adding a helper, be sure to add a line to `t/Makefile` and to the `.gitignore` for the
|
||||
binary file you add. The Git community prefers functional tests using the full `git`
|
||||
executable, so try to exercise your new code using `git` commands before creating a test
|
||||
helper.
|
||||
|
||||
To find out why a test failed, repeat the test with the `-x -v -d -i` options and then
|
||||
navigate to the appropriate "trash" directory to see the data shape that was used for the
|
||||
test failed step.
|
||||
|
||||
Read [`t/README`](t/README) for more details.
|
||||
|
||||
### Performance Tests
|
||||
|
||||
If you are working on improving performance, you will need to be acquainted with the
|
||||
performance tests in `t/perf`. There are not too many performance tests yet, but adding one
|
||||
as your first commit in a patch series helps to communicate the boost your change provides.
|
||||
|
||||
To check the change in performance across multiple versions of `git`, you can use the
|
||||
`t/perf/run` script. For example, to compare the performance of `git rev-list` across the
|
||||
`core/master` and `core/next` branches compared to a `topic` branch, you can run
|
||||
|
||||
```
|
||||
cd t/perf
|
||||
./run core/master core/next topic -- p0001-rev-list.sh
|
||||
```
|
||||
|
||||
You can also set certain environment variables to help test the performance on different
|
||||
repositories or with more repetitions. The full list is available in
|
||||
[the `t/perf/README` file](t/perf/README),
|
||||
but here are a few important ones:
|
||||
|
||||
```
|
||||
GIT_PERF_REPO=/path/to/repo
|
||||
GIT_PERF_LARGE_REPO=/path/to/large/repo
|
||||
GIT_PERF_REPEAT_COUNT=10
|
||||
```
|
||||
|
||||
When running the performance tests on Linux, you may see a message "Can't locate JSON.pm in
|
||||
@INC" and that means you need to run `sudo cpanm install JSON` to get the JSON perl package.
|
||||
|
||||
For running performance tests, it can be helpful to set up a few repositories with strange
|
||||
data shapes, such as:
|
||||
|
||||
**Many objects:** Clone repos such as [Kotlin](https://github.com/jetbrains/kotlin), [Linux](https://github.com/torvalds/linux), or [Android](https://source.android.com/setup/downloading).
|
||||
|
||||
**Many pack-files:** You can split a fresh clone into multiple pack-files of size at most
|
||||
16MB by running `git repack -adfF --max-pack-size=16m`. See the
|
||||
[`git repack` documentation](https://git-scm.com/docs/git-repack) for more information.
|
||||
You can count the number of pack-files using `ls .git/objects/pack/*.pack | wc -l`.
|
||||
|
||||
**Many loose objects:** If you already split your repository into multiple pack-files, then
|
||||
you can pick one to split into loose objects using `cat .git/objects/pack/[id].pack | git unpack-objects`;
|
||||
delete the `[id].pack` and `[id].idx` files after this. You can count the number of loose
|
||||
bjects using `ls .git/objects/??/* | wc -l`.
|
||||
|
||||
**Deep history:** Usually large repositories also have deep histories, but you can use the
|
||||
[test-many-commits-1m repo](https://github.com/cirosantilli/test-many-commits-1m/) to
|
||||
target deep histories without the overhead of many objects. One issue with this repository:
|
||||
there are no merge commits, so you will need to use a different repository to test a "wide"
|
||||
commit history.
|
||||
|
||||
**Large Index:** You can generate a large index and repo by using the scripts in
|
||||
`t/perf/repos`. There are two scripts. `many-files.sh` which will generate a repo with
|
||||
same tree and blobs but different paths. Using `many-files.sh -d 5 -w 10 -f 9` will create
|
||||
a repo with ~1 million entries in the index. `inflate-repo.sh` will use an existing repo
|
||||
and copy the current work tree until it is a specified size.
|
||||
|
||||
Test Your Changes on Linux
|
||||
--------------------------
|
||||
|
||||
It can be important to work directly on the [core Git codebase](https://github.com/git/git),
|
||||
such as a recent commit into the `master` or `next` branch that has not been incorporated
|
||||
into Git for Windows. Also, it can help to run functional and performance tests on your
|
||||
code in Linux before submitting patches to the mailing list, which focuses on many platforms.
|
||||
The differences between Windows and Linux are usually enough to catch most cross-platform
|
||||
issues.
|
||||
|
||||
### Using the Windows Subsystem for Linux
|
||||
|
||||
The [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
|
||||
allows you to [install Ubuntu Linux as an app](https://www.microsoft.com/en-us/store/p/ubuntu/9nblggh4msv6)
|
||||
that can run Linux executables on top of the Windows kernel. Internally,
|
||||
Linux syscalls are interpreted by the WSL, everything else is plain Ubuntu.
|
||||
|
||||
First, open WSL (either type "Bash" in Cortana, or execute "bash.exe" in a CMD window).
|
||||
Then install the prerequisites, and `git` for the initial clone:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install git gcc make libssl-dev libcurl4-openssl-dev \
|
||||
libexpat-dev tcl tk gettext git-email zlib1g-dev
|
||||
```
|
||||
|
||||
Then, clone and build:
|
||||
|
||||
```
|
||||
git clone https://github.com/git-for-windows/git
|
||||
cd git
|
||||
git remote add -f upstream https://github.com/git/git
|
||||
make
|
||||
```
|
||||
|
||||
Be sure to clone into `/home/[user]/` and not into any folder under `/mnt/?/` or your build
|
||||
will fail due to colons in file names.
|
||||
|
||||
### Using a Linux Virtual Machine with Hyper-V
|
||||
|
||||
If you prefer, you can use a virtual machine (VM) to run Linux and test your changes in the
|
||||
full environment. The test suite runs a lot faster on Linux than on Windows or with the WSL.
|
||||
You can connect to the VM using an SSH terminal like
|
||||
[PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/).
|
||||
|
||||
The following instructions are for using Hyper-V, which is available in some versions of Windows.
|
||||
There are many virtual machine alternatives available, if you do not have such a version installed.
|
||||
|
||||
* [Download an Ubuntu Server ISO](https://www.ubuntu.com/download/server).
|
||||
* Open [Hyper-V Manager](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v).
|
||||
* [Set up a virtual switch](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/connect-to-network)
|
||||
so your VM can reach the network.
|
||||
* Select "Quick Create", name your machine, select the ISO as installation source, and un-check
|
||||
"This virtual machine will run Windows."
|
||||
* Go through the Ubuntu install process, being sure to select to install OpenSSH Server.
|
||||
* When install is complete, log in and check the SSH server status with `sudo service ssh status`.
|
||||
* If the service is not found, install with `sudo apt-get install openssh-server`.
|
||||
* If the service is not running, then use `sudo service ssh start`.
|
||||
* Use `shutdown -h now` to shutdown the VM, go to the Hyper-V settings for the VM, expand Network Adapter
|
||||
to select "Advanced Features", and set the MAC address to be static (this can save your VM from losing
|
||||
network if shut down incorrectly).
|
||||
* Provide as many cores to your VM as you can (for parallel builds).
|
||||
* Restart your VM, but do not connect.
|
||||
* Use `ssh` in Git Bash, download [PuTTY](http://www.putty.org/), or use your favorite SSH client to connect to the VM through SSH.
|
||||
|
||||
In order to build and use `git`, you will need the following libraries via `apt-get`:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install git gcc make libssl-dev libcurl4-openssl-dev \
|
||||
libexpat-dev tcl tk gettext git-email zlib1g-dev
|
||||
```
|
||||
|
||||
To get your code from your Windows machine to the Linux VM, it is easiest to push the branch to your fork of Git and clone your fork in the Linux VM.
|
||||
|
||||
Don't forget to set your `git` config with your preferred name, email, and editor.
|
||||
|
||||
Polish Your Commits
|
||||
-------------------
|
||||
|
||||
Before submitting your patch, be sure to read the [coding guidelines](https://github.com/git/git/blob/master/Documentation/CodingGuidelines)
|
||||
and check your code to match as best you can. This can be a lot of effort, but it saves
|
||||
time during review to avoid style issues.
|
||||
|
||||
The other possibly major difference between the mailing list submissions and GitHub PR workflows
|
||||
is that each commit will be reviewed independently. Even if you are submitting a
|
||||
patch series with multiple commits, each commit must stand on it's own and be reviewable
|
||||
by itself. Make sure the commit message clearly explain the why of the commit not the how.
|
||||
Describe what is wrong with the current code and how your changes have made the code better.
|
||||
|
||||
When preparing your patch, it is important to put yourself in the shoes of the Git community.
|
||||
Accepting a patch requires more justification than approving a pull request from someone on
|
||||
your team. The community has a stable product and is responsible for keeping it stable. If
|
||||
you introduce a bug, then they cannot count on you being around to fix it. When you decided
|
||||
to start work on a new feature, they were not part of the design discussion and may not
|
||||
even believe the feature is worth introducing.
|
||||
|
||||
Questions to answer in your patch message (and commit messages) may include:
|
||||
* Why is this patch necessary?
|
||||
* How does the current behavior cause pain for users?
|
||||
* What kinds of repositories are necessary for noticing a difference?
|
||||
* What design options did you consider before writing this version? Do you have links to
|
||||
code for those alternate designs?
|
||||
* Is this a performance fix? Provide clear performance numbers for various well-known repos.
|
||||
|
||||
Here are some other tips that we use when cleaning up our commits:
|
||||
|
||||
* Commit messages should be wrapped at 76 columns per line (or less; 72 is also a
|
||||
common choice).
|
||||
* Make sure the commits are signed off using `git commit (-s|--signoff)`. See
|
||||
[SubmittingPatches](https://github.com/git/git/blob/v2.8.1/Documentation/SubmittingPatches#L234-L286)
|
||||
for more details about what this sign-off means.
|
||||
* Check for whitespace errors using `git diff --check [base]...HEAD` or `git log --check`.
|
||||
* Run `git rebase --whitespace=fix` to correct upstream issues with whitespace.
|
||||
* Become familiar with interactive rebase (`git rebase -i`) because you will be reordering,
|
||||
squashing, and editing commits as your patch or series of patches is reviewed.
|
||||
* Make sure any shell scripts that you add have the executable bit set on them. This is
|
||||
usually for test files that you add in the `/t` directory. You can use
|
||||
`git add --chmod=+x [file]` to update it. You can test whether a file is marked as executable
|
||||
using `git ls-files --stage \*.sh`; the first number is 100755 for executable files.
|
||||
* Your commit titles should match the "area: change description" format. Rules of thumb:
|
||||
* Choose "<area>: " prefix appropriately.
|
||||
* Keep the description short and to the point.
|
||||
* The word that follows the "<area>: " prefix is not capitalized.
|
||||
* Do not include a full-stop at the end of the title.
|
||||
* Read a few commit messages -- using `git log origin/master`, for instance -- to
|
||||
become acquainted with the preferred commit message style.
|
||||
* Build source using `make DEVELOPER=1` for extra-strict compiler warnings.
|
||||
|
||||
Submit Your Patch
|
||||
-----------------
|
||||
|
||||
Git for Windows [accepts pull requests on GitHub](https://github.com/git-for-windows/git/pulls), but
|
||||
these are reserved for Windows-specific improvements. For core Git, submissions are accepted on
|
||||
[the Git mailing list](https://public-inbox.org/git).
|
||||
|
||||
### Configure Git to Send Emails
|
||||
|
||||
There are a bunch of options for configuring the `git send-email` command. These options can
|
||||
be found in the documentation for
|
||||
[`git config`](https://git-scm.com/docs/git-config) and
|
||||
[`git send-email`](https://git-scm.com/docs/git-send-email).
|
||||
|
||||
```
|
||||
git config --global sendemail.smtpserver <smtp server>
|
||||
git config --global sendemail.smtpserverport 587
|
||||
git config --global sendemail.smtpencryption tls
|
||||
git config --global sendemail.smtpuser <email address>
|
||||
```
|
||||
|
||||
To avoid storing your password in the config file, store it in the Git credential manager:
|
||||
|
||||
```
|
||||
$ git credential fill
|
||||
protocol=smtp
|
||||
host=<stmp server>
|
||||
username=<email address>
|
||||
password=password
|
||||
```
|
||||
|
||||
Before submitting a patch, read the [Git documentation on submitting patches](https://github.com/git/git/blob/master/Documentation/SubmittingPatches).
|
||||
|
||||
To construct a patch set, use the `git format-patch` command. There are three important options:
|
||||
|
||||
* `--cover-letter`: If specified, create a `[v#-]0000-cover-letter.patch` file that can be
|
||||
edited to describe the patch as a whole. If you previously added a branch description using
|
||||
`git branch --edit-description`, you will end up with a 0/N mail with that description and
|
||||
a nice overall diffstat.
|
||||
* `--in-reply-to=[Message-ID]`: This will mark your cover letter as replying to the given
|
||||
message (which should correspond to your previous iteration). To determine the correct Message-ID,
|
||||
find the message you are replying to on [public-inbox.org/git](https://public-inbox.org/git) and take
|
||||
the ID from between the angle brackets.
|
||||
|
||||
* `--subject-prefix=[prefix]`: This defaults to [PATCH]. For subsequent iterations, you will want to
|
||||
override it like `--subject-prefix="[PATCH v2]"`. You can also use the `-v` option to have it
|
||||
automatically generate the version number in the patches.
|
||||
|
||||
If you have multiple commits and use the `--cover-letter` option be sure to open the
|
||||
`0000-cover-letter.patch` file to update the subject and add some details about the overall purpose
|
||||
of the patch series.
|
||||
|
||||
### Examples
|
||||
|
||||
To generate a single commit patch file:
|
||||
```
|
||||
git format-patch -s -o [dir] -1
|
||||
```
|
||||
To generate four patch files from the last three commits with a cover letter:
|
||||
```
|
||||
git format-patch --cover-letter -s -o [dir] HEAD~4
|
||||
```
|
||||
To generate version 3 with four patch files from the last four commits with a cover letter:
|
||||
```
|
||||
git format-patch --cover-letter -s -o [dir] -v 3 HEAD~4
|
||||
```
|
||||
|
||||
### Submit the Patch
|
||||
|
||||
Run [`git send-email`](https://git-scm.com/docs/git-send-email), starting with a test email:
|
||||
|
||||
```
|
||||
git send-email --to=yourself@address.com [dir with patches]/*.patch
|
||||
```
|
||||
|
||||
After checking the receipt of your test email, you can send to the list and to any
|
||||
potentially interested reviewers.
|
||||
|
||||
```
|
||||
git send-email --to=git@vger.kernel.org --cc=<email1> --cc=<email2> [dir with patches]/*.patch
|
||||
```
|
||||
|
||||
To submit a nth version patch (say version 3):
|
||||
|
||||
```
|
||||
git send-email --to=git@vger.kernel.org --cc=<email1> --cc=<email2> \
|
||||
--in-reply-to=<the message id of cover letter of patch v2> [dir with patches]/*.patch
|
||||
```
|
|
@ -443,6 +443,14 @@ Environment Variables
|
|||
---------------------
|
||||
Various Git commands use the following environment variables:
|
||||
|
||||
System
|
||||
~~~~~~
|
||||
`HOME`::
|
||||
Specifies the path to the user's home directory. On Windows, if
|
||||
unset, Git will set a process environment variable equal to:
|
||||
`$HOMEDRIVE$HOMEPATH` if both `$HOMEDRIVE` and `$HOMEPATH` exist;
|
||||
otherwise `$USERPROFILE` if `$USERPROFILE` exists.
|
||||
|
||||
The Git Repository
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
These environment variables apply to 'all' core Git commands. Nb: it
|
||||
|
|
77
README.md
77
README.md
|
@ -1,4 +1,76 @@
|
|||
[![Build status](https://github.com/git/git/workflows/CI/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush)
|
||||
Git for Windows
|
||||
===============
|
||||
|
||||
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/git-for-windows/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)
|
||||
[![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
|
||||
of [Git](http://git-scm.com/).
|
||||
|
||||
The Git for Windows project is run using a [governance
|
||||
model](http://git-for-windows.github.io/governance-model.html). If you
|
||||
encounter problems, you can report them as [GitHub
|
||||
issues](https://github.com/git-for-windows/git/issues), discuss them on Git
|
||||
for Windows' [Google Group](http://groups.google.com/group/git-for-windows),
|
||||
and [contribute bug
|
||||
fixes](https://github.com/git-for-windows/git/wiki/How-to-participate).
|
||||
|
||||
To build Git for Windows, please either install [Git for Windows'
|
||||
SDK](https://gitforwindows.org/#download-sdk), start its `git-bash.exe`, `cd`
|
||||
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:
|
||||
|
||||
- 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
|
||||
=========================================================
|
||||
|
@ -29,7 +101,7 @@ CVS users may also want to read [Documentation/gitcvs-migration.txt][]
|
|||
(`man gitcvs-migration` or `git help cvs-migration` if git is
|
||||
installed).
|
||||
|
||||
The user discussion and development of Git take place on the Git
|
||||
The user discussion and development of core Git take place on the Git
|
||||
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
|
||||
|
@ -43,6 +115,7 @@ To subscribe to the list, send an email with just "subscribe git" in
|
|||
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
|
||||
the Git Security mailing list <git-security@googlegroups.com>.
|
||||
|
|
50
SECURITY.md
50
SECURITY.md
|
@ -28,24 +28,38 @@ Examples for details to include:
|
|||
|
||||
## Supported Versions
|
||||
|
||||
There are no official "Long Term Support" versions in Git.
|
||||
Instead, the maintenance track (i.e. the versions based on the
|
||||
most recently published feature release, also known as ".0"
|
||||
version) sees occasional updates with bug fixes.
|
||||
Git for Windows is a "friendly fork" of [Git](https://git-scm.com/), i.e. changes in Git for Windows are frequently contributed back, and Git for Windows' release cycle closely following Git's.
|
||||
|
||||
Fixes to vulnerabilities are made for the maintenance track for
|
||||
the latest feature release and merged up to the in-development
|
||||
branches. The Git project makes no formal guarantee for any
|
||||
older maintenance tracks to receive updates. In practice,
|
||||
though, critical vulnerability fixes are applied not only to the
|
||||
most recent track, but to at least a couple more maintenance
|
||||
tracks.
|
||||
While Git maintains several release trains (when v2.19.1 was released, there were updates to v2.14.x-v2.18.x, too, for example), Git for Windows follows only the latest Git release. For example, there is no Git for Windows release corresponding to Git v2.16.5 (which was released after v2.19.0).
|
||||
|
||||
This is typically done by making the fix on the oldest and still
|
||||
relevant maintenance track, and merging it upwards to newer and
|
||||
newer maintenance tracks.
|
||||
One exception is [MinGit for Windows](https://github.com/git-for-windows/git/wiki/MinGit) (a minimal subset of Git for Windows, intended for bundling with third-party applications that do not need any interactive commands nor support for `git svn`): critical security fixes are backported to the v2.11.x, v2.14.x, v2.19.x, v2.21.x and v2.23.x release trains.
|
||||
|
||||
For example, v2.24.1 was released to address a couple of
|
||||
[CVEs](https://cve.mitre.org/), and at the same time v2.14.6,
|
||||
v2.15.4, v2.16.6, v2.17.3, v2.18.2, v2.19.3, v2.20.2, v2.21.1,
|
||||
v2.22.2 and v2.23.1 were released.
|
||||
## Version number scheme
|
||||
|
||||
The Git for Windows versions reflect the Git version on which they are based. For example, Git for Windows v2.21.0 is based on Git v2.21.0.
|
||||
|
||||
As Git for Windows bundles more than just Git (such as Bash, OpenSSL, OpenSSH, GNU Privacy Guard), sometimes there are interim releases without corresponding Git releases. In these cases, Git for Windows appends a number in parentheses, starting with the number 2, then 3, etc. For example, both Git for Windows v2.17.1 and v2.17.1(2) were based on Git v2.17.1, but the latter included updates for Git Credential Manager and Git LFS, fixing critical regressions.
|
||||
|
||||
## Tag naming scheme
|
||||
|
||||
Every Git for Windows version is tagged using a name that starts with the Git version on which it is based, with the suffix `.windows.<patchlevel>` appended. For example, Git for Windows v2.17.1' source code is tagged as [`v2.17.1.windows.1`](https://github.com/git-for-windows/git/releases/tag/v2.17.1.windows.1) (the patch level is always at least 1, given that Git for Windows always has patches on top of Git). Likewise, Git for Windows v2.17.1(2)' source code is tagged as [`v2.17.1.windows.2`](https://github.com/git-for-windows/git/releases/tag/v2.17.1.windows.2).
|
||||
|
||||
## Release Candidate (rc) versions
|
||||
|
||||
As a friendly fork of Git (the "upstream" project), Git for Windows is closely corelated to that project.
|
||||
|
||||
Consequently, Git for Windows publishes versions based on Git's release candidates (for upcoming "`.0`" versions, see [Git's release schedule](https://tinyurl.com/gitCal)). These versions end in `-rc<n>`, starting with `-rc0` for a very early preview of what is to come, and as with regular versions, Git for Windows tries to follow Git's releases as quickly as possible.
|
||||
|
||||
Note: there is currently a bug in the "Check daily for updates" code, where it mistakes the final version as a downgrade from release candidates. Example: if you installed Git for Windows v2.23.0-rc3 and enabled the auto-updater, it would ask you whether you want to "downgrade" to v2.23.0 when that version was available.
|
||||
|
||||
[All releases](https://github.com/git-for-windows/git/releases/), including release candidates, are listed via a link at the footer of the [Git for Windows](https://gitforwindows.org/) home page.
|
||||
|
||||
## Snapshot versions ('nightly builds')
|
||||
|
||||
Git for Windows also provides snapshots (these are not releases) of the the current development as per git-for-Windows/git's `master` branch at the [Snapshots](https://wingit.blob.core.windows.net/files/index.html) page. This link is also listed in the footer of the [Git for Windows](https://gitforwindows.org/) home page.
|
||||
|
||||
Note: even if those builds are not exactly "nightly", they are sometimes referred to as "nightly builds" to keep with other projects' nomenclature.
|
||||
|
||||
## Following upstream's developments
|
||||
|
||||
The [gitforwindows/git repository](https://github.com/git-for-windows/git) also provides the `shears/*` branches. The `shears/*` branches reflect Git for Windows' patches, rebased onto the upstream integration branches, [updated (mostly) via automated CI builds](https://dev.azure.com/git-for-windows/git/_build?definitionId=25).
|
||||
|
|
Загрузка…
Ссылка в новой задаче