update git version in docker container

By : Alex
Source: Stackoverflow.com
Question!

I am implementing a node.js application in docker, that needs to make use of the git worktree feature. However, even if I do :

RUN apt-get update && apt-get install -y git=2.10.0

it can't find any other version after 2.1.0

I am building the image from :

FROM node:4.4.2 

How can I get the latest git version that supports the worktree feature installed on a docker container

By : Alex


Answers
As of the time of this post, no package repos from Debian include a version beyond 2.9. If you need a newer version, you'll need to download and install that from source which is documented on git-scm, or find another repo.

By : BMitch


See http://askubuntu.com/a/568596/159234

RUN apt-add-repository ppa:git-core/ppa && apt-get update && apt-get install -y git


This video can help you solving your question :)
By: admin