Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.86 KB

git-from-src.md

File metadata and controls

61 lines (42 loc) · 1.86 KB

Git Build/Install from Source Script

Install an up-to-date version of Git and build from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies.

Script status: Stable

OS support: Debian 9+, Ubuntu 18.04+, and downstream distros.

Maintainer: The VS Code and GitHub Codespaces teams

Syntax

./git-from-src-debian.sh [Version] [Use PPA if available]

Or as a feature:

"features": {
    "git": {
        "version": "latest",
        "ppa": false
    }
}
Argument Feature option Default Description
Version version latest Version of Git to build and install. Use latest to install the latest stable version. Use os-provided to skip building and install the pre-compiled version of Git comes with the Linux distribution instead (much faster).
Use PPA if available ppa false If using Ubuntu and a build already exists in the git-core PPA, use it instead of building from scratch.

Usage

Feature use

You can use this script for your primary dev container by adding it to the features property in devcontainer.json.

"features": {
    "git": {
        "version": "latest",
        "ppa": false
    }
}

If you have already built your development container, run the Rebuild Container command from the command palette (Ctrl/Cmd + Shift + P or F1) to pick up the change.

Script use

  1. Add git-from-src-debian.sh to .devcontainer/library-scripts

  2. Add the following to your .devcontainer/Dockerfile:

    COPY library-scripts/git-from-src-debian.sh /tmp/library-scripts/
    RUN apt-get update && bash /tmp/library-scripts/git-from-src-debian.sh

That's it!