Skip to content

How To: build instructions

Igor Velikorossov edited this page Nov 26, 2023 · 28 revisions

Clone

  1. Fork the project.
  2. Clone the project from your fork with all submodules:
    git clone -v --recurse-submodules https://github.com/<your fork>/gitextensions
    
  3. Add the main trunk as your secondary remote so you can easily track the project changes:
    git remote add --mirror=fetch remote https://github.com/gitextensions/gitextensions
    

How to build and test on MS Windows

Git Extensions version Build tools .NET
Current dev branch Visual Studio 2022 (v17.8+), C# 12 featureset .NET 8.0 SDK
Version 4.0- (release/4.0) Visual Studio 2022 (v17.2+), C# 10 featureset .NET 6.0 SDK
Version 3.5- (release/3.x) Visual Studio 2019 (v16.8+), C# 9 featureset .NET 4.7.2 Targeting Pack
Version 2.5x (release/2.5x) Visual Studio 2015/2017 .NET 4.7.2 Targeting Pack
  • Community Edition is sufficient.
  • You need .NET and .NET for desktop development
  • You need C++ to build the solution including Explorer integration.
  • WiX ToolSet is needed only if you want to run the installer, the setup project does not have to loaded.
  • As building can be done from the command line, Visual Studio GUI is not strictly required, but for instance build tools need to be installed separately.
  • Visual Studio Code can be used to build and debug in the development branch.

Current dev branch

Build solution

The solution can be built from Visual Studio or from a command line. You will still need Visual Studio for the UI work, but for everything else you can use your favourite IDE (such as Visual Studio Code).

⚠️ Make sure to synchronize and update all submodules using GitExtensions.

  • From Visual Studio simply set "GitExtensions" as a start project and hit F5 after the solution has finished loading.
  • From command line run one of the following commands.
    • dotnet build to build the solution
    • dotnet run --project GitExtensions to run the app

Run tests

  • From Visual Studio Start "Test Explorer" to run the NUnit tests. Ctrl+R, A to run all tests in solution.

  • From command line run one of the following commands.

    • dotnet test to run tests

    You can also run individual tests by navigating to a test project folder and running dotnet test command, e.g.

     pushd .\gitextensions\UnitTests\GitExtUtils.Tests
     dotnet test --filter ArgumentBuilderTests

Update English translations

  • Learn how we deal with translations. From command line run one of the following commands.
    • dotnet build /p:RunTranslationApp=true to update English translations if you have changed those.

Package app

  • From command line run one of the following commands.
    • dotnet build .\scripts\native.proj
    • dotnet publish

to generate a portable build and a local setup.exe.

v3.4 and v3.5

Build solution

The solution can be built from Visual Studio or from a command line. You will still need Visual Studio for the UI work, but for everything else you can use your favourite IDE (such as Visual Studio Code).

⚠️ Make sure to synchronize and update all submodules using GitExtensions.

  • From Visual Studio simply set "GitExtensions" as a start project and hit F5 after the solution has finished loading.
  • From command line run one of the following commands.
    • build.cmd to build the solution

📝 For more switches refer to the build script.

Run tests

  • From Visual Studio Install VS Extension "NUnit3 Test Adapter" to run the NUnit tests. Ctrl+R, A to run all tests in solution.

  • From command line run one of the following commands.

    • build.cmd -test to run unit tests
    • build.cmd -integrationTest to run UI integration tests
    • build.cmd -test -integrationTest to run both kinds of tests

    You can also run individual tests by navigating to a test project folder and running dotnet test command, e.g.

     pushd .\gitextensions\UnitTests\GitExtUtils.Tests
     dotnet test --filter ArgumentBuilderTests

Update English translations

Package app

  • From command line run one of the following commands.
    • .\cibuild.cmd -restore
    • .\cibuild.cmd -build
    • .\cibuild.cmd -buildNative
    • .\cibuild.cmd -publish

to generate a portable build and a local setup.exe.

v3.3 and older

Build solution

The solution can be built from Visual Studio. It is technically possible to build from a command line using MSBuild but it is not as refined as v4.

  1. Synchronize and update all submodules using GitExtensions.
  2. Restore Nuget packages If you have never set up NuGet, open Visual Studio, and go to Tools > Options. Select "NuGet Package Manager". Be sure "Allow NuGet to download missing packages" and "Automatically check for missing packages during build" are checked.
  3. Open GitExtensions.sln.
  4. Push F5 to build and run GitExtensions project.

Run tests

Install VS Extension "NUnit3 Test Adapter" to run the NUnit tests. Ctrl+R, A to run all tests in solution.

Package app

  • install Visual Studio C++ featureset including "Visual C++ ATL for x86 and x64"
  • Run \Setup\BuildInstallers.cmd

How to build and test on Linux under Mono (v2.5x)

This stream contains the last cross-platform version running both on Windows (MS .NET Framework) and on Linux/Mac (Mono).
The code is in maintenance mode with no significant active development planned. Only certain bug fixes are currently ported across, however there may be consideration given for certain features to be ported across from the v3.x stream.

For more details please refer to versions comparison.

Code: release/2.5
  Windows Linux/Mac
Runtime environment MS Windows 7SP1+
MS .NET Framework 4.6.1+
Linux / Mac (possible)
Mono 5.0+ (Recommended 5.14.0 or later)
Development MS VS 2015/2017, C#6 MonoDevelop / JetBrains Rider / MS VS for Mac
Current dev status Build status
  1. Synchronize and update all submodules using GitExtensions.
  2. Restore Nuget packages.
  3. Open GitExtensionsMono.sln.
  4. Push F5 to build and run GitExtensions project.

Building the installer

  • Not supported

Running tests

Use the mechanics built-in to IDE of your choice.

See Git Extensions on Linux for more information.