Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Latest commit

 

History

History
67 lines (45 loc) · 2.34 KB

git-from-src.md

File metadata and controls

67 lines (45 loc) · 2.34 KB

IMPORTANT NOTE: We're starting to migrate contents of this repo to the devcontainers org, as part of the work on the open dev container specification.

We've currently migrated the git Feature to devcontainers/features/src/git.

For more details, you can review the announcement issue.

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!