Build scripts and customizations for creating the Git Shell environment included in GitHub Desktop
Перейти к файлу
Brendan Forster 69bd5e6f85 tweak the output destination 2017-08-23 15:17:37 +10:00
7-Zip portable: use statically-linked SFX 2017-04-06 00:36:03 +02:00
archive Quote the path properly when making the portable archive 2015-12-14 12:01:49 +01:00
git-extra git-extra: new version 2017-08-22 11:36:31 +02:00
git-for-windows-keyring Ignore a couple more generated files 2017-06-26 12:43:37 +02:00
git-shell tweak the output destination 2017-08-23 15:17:37 +10:00
git-tfs corrected package maintainer after initial copy-pasta problem 2015-10-07 13:21:29 +02:00
github-extra i don't think we need this any more 2017-08-23 15:12:43 +10:00
installer Merge branch 'ensure-uptodate-dll-copies' 2017-08-22 18:03:13 +02:00
mingit mingit: allow to build BusyBox-based versions 2017-08-05 23:15:29 +02:00
mingw-w64-cv2pdb Ignore a couple more generated files 2017-06-26 12:43:37 +02:00
mingw-w64-git-credential-manager Upgrade mingw-w64-git-credential-manager to 1.12.0 2017-08-03 17:36:40 +02:00
mingw-w64-git-lfs Fix line endings 2017-08-18 18:01:56 +02:00
msi msi: respect user's choice of terminal emulator 2016-06-20 20:48:16 -04:00
nuget Also move core Git's .exe files out of libexec in the MinGit NuPkg 2017-03-10 18:03:33 +01:00
portable Merge remote-tracking branch 'git-for-windows/master' 2017-08-23 13:57:15 +10:00
sdk-installer sdk-installer: shallow clone the git source 2017-08-05 00:50:23 +02:00
.gitattributes Mark remaining shell scripts as LF-only 2017-05-02 14:20:14 +02:00
.gitignore tweak ignore files 2017-08-23 14:16:04 +10:00
LICENSE.txt Move the license file used in the installer into the top-level directory 2016-07-04 08:54:02 +02:00
Makefile installer: switch to using edit-git-bash.exe 2016-09-01 08:08:51 +02:00
README.md Merge remote-tracking branch 'origin/master' into update-tooling 2016-04-13 13:09:47 +10:00
ReleaseNotes.css Move ReleaseNotes.{css,md} and update scripts 2016-05-22 22:31:55 -04:00
ReleaseNotes.md Mention Bug Fix in release notes 2017-08-22 11:45:55 +02:00
apply-from-public-inbox.sh apply-from-public-inbox: accept thread URLs, too 2017-03-27 17:27:01 +02:00
commit-msys2.sh commit-msys2.sh: make sure to keep line endings intact 2016-11-14 18:05:15 +01:00
download-stats.sh download-stats: new Git for Windows version 2017-08-10 22:07:37 +02:00
edit-git-bash.c Add debug output to edit-git-bash 2016-06-19 17:49:23 -04:00
get-sources.sh get-sources: work around incorrectly-recorded cURL pkgrel 2017-08-10 23:56:30 +02:00
git-for-windows.svg Add the Git for Windows icon 2015-03-23 15:25:07 +01:00
git-for-windows.xcf Add 48x48 and 24x24 versions of the Got for Windows icon 2015-03-28 12:57:57 +01:00
git.ico msi: move git.ico so all installers can access it 2016-05-22 22:31:55 -04:00
gpl-2.0.rtf innosetup: move GPL license RTF to build-extra 2016-05-22 22:31:55 -04:00
install-custom-packages.sh force is bad 2015-10-26 15:39:04 +01:00
make-file-list.sh no git-lfs bundled in the box 2017-08-23 14:09:42 +10:00
package-git-shell.sh split this script into two distinct tasks 2015-10-06 15:46:50 +02:00
pacman-helper.sh pacman-helper: bring the big hammer against those timeout issues 2017-08-09 14:54:15 +02:00
please.sh please.sh rebase: allow --jump again ;-) 2017-08-22 10:55:05 +02:00
post-install.bat Mark scripts as executable 2015-09-28 22:48:44 +02:00
render-release-notes.sh render-release-notes: accept -p as a shortcut for --preview 2016-06-15 10:09:07 +02:00
send-to-virus-total.sh Add a helper to submit files or URLs to VirusTotal 2015-10-07 16:13:25 +00:00
shears.sh shears: allow overriding the editor via GIT_EDITOR 2017-07-03 17:37:23 +02:00
update-upstream-packages.sh split upstream packages and local packages apart 2015-10-26 12:10:56 +01:00
upload-to-github.sh upload-to-github: fix release URL to edit at the end 2015-10-20 11:30:56 +02:00
wingit-snapshot-helper.sh wingit-snapshot-helper add-snapshot: include MinGit if available 2017-04-13 23:26:39 +02:00

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.

Git Shell

This is a tailored build environment for creating the Git Shell tools in GitHub for Windows. Don't try and install these releases by hand - either grab one of the vanilla Git for Windows releases or install GitHub for Windows.

Creating a Release

You need to have the 32-bit Git SDK installed on your machine. Grab it from here.

Once you've installed that (it'll take a while to download and bootstrap the environment), this is all you need to run:

git clone https://github.com/github/ghfw-build-extra.git cd ghfw-build-extra ./update-git-shell.sh ./package-git-shell.sh

We add a couple of things to the default Git for Windows SDK:

  • git-tfs - support for git tfs in the box
  • github-extra - configuration customizations

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").