I don't think this is possible without a bit of hacking but just throwing it out there.
In Git is it possible to relocate the bulk of the .git folder (/objects i assume) to another location. I am having a problem without my current hard drive filling up with git and i want to be able to move it to a separate hard drive to free up space.
There are three possibilities I can think of:
GIT_DIR environment variable tells Git where to look for the repository. The default is .git, obviously, but you can also set it to /some/where/else, if you want.GIT_OBJECT_DIR environment variable does the same, but just for the .git/objects subdirectory, not the whole repository..git/objects/info/alternates or the environment variable $GIT_ALTERNATE_OBJECT_DIRECTORIES to "borrow" objects from another repository.See the git-repositorylayout(5) manual page for details.
Git has a command line option called --git-dir. Whenever you run git, use the --git-dir option.
git --git-dir=a_different_git_directory status
Perhaps you could put that in a batch file or something to make your life easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With