Created
May 6, 2026 08:11
-
-
Save PRO-2684/1edc69e5c8fb29f9ee00414ec85adf80 to your computer and use it in GitHub Desktop.
Update git to 2.50.1 on Ubuntu 20.04 without building from source (user-scope)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p ~/opt/git | |
| cd ~/opt/git | |
| # download packages | |
| wget https://ppa.launchpadcontent.net/git-core/ppa/ubuntu/pool/main/g/git/git_2.50.1-0ppa1~ubuntu20.04.1_amd64.deb | |
| wget https://ppa.launchpadcontent.net/git-core/ppa/ubuntu/pool/main/g/git/git-man_2.50.1-0ppa1~ubuntu20.04.1_all.deb | |
| dpkg-deb -x git_*.deb root | |
| dpkg-deb -x git-man_*.deb root | |
| mkdir -p ~/bin | |
| cat > ~/bin/git <<'EOF' | |
| #!/usr/bin/env bash | |
| ROOT="$HOME/opt/git/root/usr" | |
| export PATH="$ROOT/bin:$PATH" | |
| export GIT_EXEC_PATH="$ROOT/lib/git-core" | |
| exec "$ROOT/bin/git" "$@" | |
| EOF | |
| chmod +x ~/bin/git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment