Additional files and scripts to help build Git for Windows on MSYS2.
Clone or download
Git for Windows Build Agent
Git for Windows Build Agent Mention New Feature in release notes
Comes with [OpenSSH v7.9p1](https://www.openssh.com/txt/release-7.9).

Signed-off-by: Git for Windows Build Agent <ci@git-for-windows.build>
Latest commit a86dbe0 Oct 19, 2018
Permalink
Failed to load latest commit information.
7-Zip portable: use statically-linked SFX Apr 5, 2017
archive archive/release.sh: try to work around `tar: file changed as we read it` Oct 23, 2017
git-extra git-extra: new version Aug 21, 2018
git-for-windows-keyring Ignore a couple more generated files Jun 26, 2017
installer Merge pull request #200 from ungps/master Sep 29, 2018
mingit mingit: offer to include the .pdb files Mar 15, 2018
mingw-w64-cv2pdb Update cv2pdb to latest Jul 18, 2018
mingw-w64-git-credential-manager Upgrade mingw-w64-git-credential-manager to 1.18.2 Oct 18, 2018
mingw-w64-git-lfs Upgrade mingw-w64-git-lfs to 2.5.2 Sep 18, 2018
mingw-w64-git-sizer Upgrade mingw-w64-git-sizer to 1.3.0 Sep 25, 2018
mingw-w64-wintoast wintoast: build with MSBuild Nov 17, 2017
msbuild Update cv2pdb to latest Jul 18, 2018
msi Use the new homepage consistently Feb 12, 2018
nuget Use the new homepage consistently Feb 12, 2018
portable Fixed explanation of --cd-to-home Mar 27, 2018
sdk-installer sdk-installer: work around objdump problem Apr 11, 2018
versions versions: add v2.19.1 Oct 4, 2018
.gitattributes installer: fix indentation Sep 28, 2018
.gitignore Ignore a couple more generated files Apr 24, 2018
LICENSE.txt Move the license file used in the installer into the top-level directory Jul 13, 2016
Makefile installer: switch to using edit-git-bash.exe Sep 1, 2016
README.md Use the new homepage consistently Feb 12, 2018
ReleaseNotes.css Move ReleaseNotes.{css,md} and update scripts May 23, 2016
ReleaseNotes.md Mention New Feature in release notes Oct 19, 2018
apply-from-public-inbox.sh apply-from-public-inbox: accept thread URLs, too Mar 27, 2017
commit-msys2.sh commit-msys2: make it easier to add new packages Nov 10, 2017
download-stats.sh download-stats: new Git for Windows version Oct 5, 2018
edit-git-bash.c Add debug output to edit-git-bash Jun 19, 2016
estimate-installation-size.sh estimate-installation-size: prefer innounp if available Feb 14, 2018
get-sources.sh get-sources: find libpcre2_8's primary package Sep 13, 2018
git-for-windows.svg Add the Git for Windows icon Mar 23, 2015
git-for-windows.xcf Add 48x48 and 24x24 versions of the Got for Windows icon Mar 28, 2015
git.ico msi: move git.ico so all installers can access it May 23, 2016
gpl-2.0.rtf innosetup: move GPL license RTF to build-extra May 23, 2016
make-file-list.sh Exclude git-archimport from installer/portable Git/etc Aug 22, 2018
pacman-helper.sh pacman-helper: use gpg.program, if set Jun 28, 2018
please.sh please.sh upgrade git: create more complete build-extra.bundle Sep 13, 2018
post-install.bat post-install.bat: fix an incorrect file extension May 15, 2018
pull_request_template.md Replace DCO explanation URL with permalink in PR template. Jul 6, 2018
render-release-notes.sh Use the new homepage consistently Feb 12, 2018
send-to-virus-total.sh Add a helper to submit files or URLs to VirusTotal Oct 7, 2015
shears.sh shears: fix non --merging run after a --merging run Oct 4, 2018
upload-to-github.sh upload-to-github: fix previous "fix" Apr 4, 2018
wingit-snapshot-helper.sh snapshots: pick up MinGit(BusyBox) if available Apr 26, 2018

README.md

Build environment for Git for Windows

This is Git for Windows SDK, the build environment for Git for Windows.

The easiest way to install Git for Windows SDK is via the Git SDK installer. This installer will clone our repositories, including all the necessary components to build Git for Windows, and perform an initial build. It will also install a shortcut to the Git SDK Bash on the desktop.

To check out the build-extra project in the Git SDK, issue the following commands in the Git SDK Bash:

cd /usr/src/build-extra
git fetch
git checkout master

Components of the Git for Windows SDK

The build environment brings all the necessary parts required to build a Git for Windows installer, or a portable Git for Windows ("portable" == "USB drive edition", i.e. you can run it without installing, from wherever it was unpacked).

Git for Windows

The most important part of Git for Windows is Git, obviously. The Git for Windows project maintains a friendly fork of the "upstream" Git project. The idea is that the Git for Windows repository serves as a test bed to develop patches and patch series that are specific to the Windows port, and once the patches stabilized, they are submitted upstream.

MSYS2

Git is not a monolithic executable, but consists of a couple of executables written in C, a couple of Bash scripts, a couple of Perl scripts, and a couple of Tcl/Tk scripts. Some parts (not supported by Git for Windows yet) are written in other script languages, still.

To support those scripts, Git for Windows uses MSYS2, a project providing a minimal POSIX emulation layer (based on Cygwin), a package management system (named "Pacman", borrowed from Arch Linux) and a number of packages that are kept up-to-date by an active team of maintainers, including Bash, Perl, Subversion, etc.

The difference between MSYS2 and MinGW

MSYS2 refers to the libraries and programs that use the POSIX emulation layer ("msys2 runtime", derived from Cygwin's cygwin1.dll). It is very easy to port libraries and programs from Unix/Linux because most of the POSIX semantics is emulated reasonably well, for example the fork() function. Bash and Perl are examples of MSYS2 programs.

MinGW refers to libraries and programs that are compiled using GNU tools but do not require any POSIX semantics, instead relying on the standard Win32 API and the C runtime library. MinGW stands for "Minimal GNU for Windows". Examples: cURL (a library to talk to remote servers via HTTP(S), (S)FTP, etc), emacs, Inkscape, etc

The POSIX emulation layer of MSYS2 binaries is convenient, but comes at a cost: Typically, MSYS2 programs are noticably slower than their MinGW counterparts (if there are such counterparts). As a consequence, the Git for Windows project tries to provide as many components as possible as MinGW binaries.

MinGW packages

The MinGW packages are built from the MINGW-packages repository which can be initialized in the Git SDK Bash via

cd /usr/src/MINGW-packages
git fetch
git checkout master

The packages inside the /usr/src/MINGW-packages/ directory can then be built by executing makepkg-mingw -s in the appropriate subdirectory.

MinGW packages can be built for both i686 and x86_64 architectures at the same time by making sure that both toolchains are installed (pacman -Sy mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain) before running makepkg-mingw.

MSYS2 packages

The MSYS2 packages are built from the MSYS2-packages repository which can be initialized in the Git SDK Bash via

cd /usr/src/MSYS2-packages
git fetch
git checkout master

To build the packages inside the /usr/src/MSYS2-packages/ directory, the user has to launch a special shell by double-clicking the msys2_shell.bat script in the top-level directory of the Git SDK, switch the working directory to the appropriate subdirectory of /usr/src/MSYS2-packages/ and then execute makepkg -s. Before the first MSYS2 package is built, the prerequisite development packages have to be installed by executing pacman -Sy base-devel binutils.

Installer generators

The Git for Windows project aims to provide three different types of installers:

  • Git for Windows for end users. The subdirectory installer/ contains the files to generate this installer.
  • Portable Git for Windows for end users ("USB drive edition"). This installer is actually a self-extracting .7z archive, and can be generated using the files in portable/.
  • The Git for Windows SDK for Git for Windows contributors. This is a complete development environment to build Git for Windows, including Git, Bash, cURL, etc (including these three installers, of course). The files to generate this installer live in sdk-installer/.

Support scripts/files

The build-extra repository is also the home of other resources necessary to develop and maintain Git for Windows. For example, it contains the Git garden shears that help with updating Git for Windows' source code whenever new upstream Git versions are released ("merging rebase").