Custom Git installation setup

I am looking for a Git installation in a custom location other than the default usr/local/git/bin/git installed by the package installer from http://git-scm.com/ the site installs.

For example, I just tried to copy the contents of usr/local/git to /Users/braitsch/my-git and update my path variable to /Users/braitsch/my-git/bin , and now Git is not happy that it cannot find some of their commands like git -stash .

I also just tried setting ./git exec-path=/Users/braitsch/my-git/libexec/git-core , but this does not seem to accept.

So, my question is for you, how can you configure a custom Git installation without using package managers or built-in installers? I would like to find a script that I could easily use on both Mac and Windows. Thanks in advance.

- Update -

It seems that Git stash (and possibly other commands) will fail if you move the directory that is installed in usr/local/git through the package installer to another location. Does anyone have any suggestions on how to get around this? I am trying to run Git from a user location, but it seems that this is not possible through the builds on the http://git-scm.com website?

+6
source share
3 answers

What works fine for me (including git stash ) is to clone the git repository for example. from:

 cd git clone git://github.com/gitster/git.git cd git make 

(I previously installed build dependencies with sudo apt-get build-dep git , which will work with a recent Debian-based distribution - otherwise, if you get a build error, you just need to install the w20> build dependencies with any mechanism usually use.)

Then you can call this git with:

 $ export GIT_EXEC_PATH=~/git/ $ ~/git/git --version git version 1.7.7.rc0.72.g4b5ea 

... or using ~/git/git --exec-path=/home/mark/git instead of the environment variable.

You can move the constructed source tree anywhere, and it still works, for example:

 $ mv ~/git ~/tmp/ $ export GIT_EXEC_PATH=~/tmp/git/ $ ~/tmp/git/git --version git version 1.7.7.rc0.72.g4b5ea 
+3
source

I would just rebuild it from the source. Take tarball from http://git-scm.com/ , then create it using ./configure --prefix=/path/to/my-git/ .

Change I'm not sure how to make a git roaming installation, but if you start by creating it using a special, unique prefix, install it, then grepping through the installed files for the prefix (i.e. grep -R my-git /path/to/my-git/ ), which is likely to be a good starting point.

+2
source

Use a virtual machine (virtual boxing is free), as well as create and use on a Linux machine. By creating your own, you can easily switch versions.

Hope this helps.

-3
source

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


All Articles