Is there an easy way to manage multiple versions of git?

In other words, is there a git version control tool similar to nvm and rvm for node and ruby ​​(respectively)?

EDIT:

I think the title of my question is somewhat misleading. I really do not want to work with several versions at the same time, as such. It is just annoying to download the source archives and build / install manually. It would be great to simplify this process. Although common package management tools exist, such as brew , yum and apt , they can be slowly updated and they vary between platforms. One simple interface to install / update git will make me happy :)

Let's say I want to stay up to date with the latest version of git or even install it recently in a new window / account without having to complete all the build steps manually. In my beautiful world, it would be as simple as doing something like this:

 $ git --version -bash: git: command not found $ curl -sL https://SOMEURL | bash use latest downloading v1.8.0... building v1.8.0... done! using git v1.8.0 $ git --version git version v1.8.0 $ gvm ls v1.8.0 * default -> 1.8 (v1.8.0) 

Or, updating as follows:

 $ git --version git version 1.7.9.1 $ gvm ls v1.7.9.1 v1.7.8 v1.7.7.5 * default -> 1.7 (v1.7.9.1) $ gvm install latest downloading 1.8.0... building 1.8.0... done! $ gvm alias default 1.8 $ gvm use default now using git v1.8.0 $ git --version git version 1.8.0 $ gvm ls v1.8.0 v1.7.9.1 v1.7.8 v1.7.7.5 * default -> 1.8 (v1.8.0) 
+4
source share
2 answers

Given that Git is very stable with repository repository , the reason for working with multiple versions of git is low.
Most of the missing features will affect the client, and not its ability to push / remove from a remote repository (with the exception of some transport mechanisms that are missing for git up to 1.6.4 ).

That is why there is no tool for this. It is said:

  • nothing prevents you from compiling so much git locally with a different installation path.
  • you can still use yum install git-core , or if you are using a Debian based distribution like Ubuntu, apt-get install git-core .
    However, it will not allow multiple installations of the same package .
    But you can find and select one version that you want at any given time: yum search git-core .
+3
source

Not that I heard. However, you can use the distribution package manager to complete this task.

For example, Mac users who have Homebrew installed can use the brew switch command to change the currently active version of a particular package. The same trick can be used with many other package managers.

+4
source

Source: https://habr.com/ru/post/1442242/


All Articles