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.
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
./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. |
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.
-
Add
git-from-src-debian.sh
to.devcontainer/library-scripts
-
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!