I am currently working on a remote using Lmod for handling modules. I want to use Magit with the repositories on this remote, but the default system version of Git is 1.x.
However, Git 2.18 is available on the cluster as a module (accessible at /software/git-2.18/bin/git
), which I already called in my .bashrc
through module add git-2.18
.
When Magit connects to the remote through Tramp, though, it still calls Git 1.x, resulting in
Error (magit): Magit requires Git >= 2.2.0, but on /ssh:myremote: the version is 1.x.x.
If multiple Git versions are installed on the host, then the
problem might be that TRAMP uses the wrong executable.
First check the value of `magit-git-executable'. Its value is
used when running git locally as well as when running it on a
remote host. The default value is "git", except on Windows
where an absolute path is used for performance reasons.
If the value already is just "git" but TRAMP never-the-less
doesn't use the correct executable, then consult the info node
`(tramp)Remote programs'.
(The default value was Git already)
I currently fixed this temporarily by setting the custom variable magit-remote-git-executable
to "/software/git-2.18/bin/git"
, but it makes it impossible to work on other remotes without modifying the variable manually each time.
Would you have any thoughts on how to fix this on either end?
Thanks