tortoisegit: Setting path to git.exe to an invariable destination - tortoisegit

we are using tortoisegit 2.11.0 and the PATH variable at windows is pointing to the standard installation path at c:\Program Fles..... Can't change this because of system rights!
Now, our git.exe to use is located on a network storage! So I changed the path to the git.exe in the options dialog to the network location.
Everything fine!
But from time to time the path suddenly changed to the standard git-installation path?
The problem occures if the network storage is not avaliable or the tortoise client ist started a little bit before the netword drive is connected!
So how can I set the path to git.exe to an invariable destination that tortoise will not change it automatically back if the source is not available?
Is there a parameter in the .gitconfig or somewhat?
Thanks for your help!

As of TortoiseGit 2.13 there is no way to disable the Git.exe detection mechanism.
It tries to find a git.exe on the path and looks for the installation path of the Git for Windows bundle if not Git.exe is configured yet.
The path is stored in registry, maybe you can create a .reg file to set it back (HKEY_CURRENT_USER\SOFTWARE\TortoiseGit; MSysGit).
It might help not to have another git installation available on the system.

Related

How to fix the git-upload-pack issue in Windows 10 Git

There are several answer but I couldn't understand it to well.
I set up a bare repo in my desktop at C:/git/project1
my local ip is 192.168.0.2
when I tried to clone project1 in my laptop: Roi#192.168.0.2
git-upload-pack not recognized pops up.
is there a step-by-step procedure to fix this?
I'm new to git generally so I have little idea of the configs etc.
Assuming that ssh Roi#192.168.0.2 works (from your laptop, opening a shell session to your desktop), you need to make sure C:\path\to\Git\bin is in the system PATH of your desktop.
An alternative would be to defined a shared folder on your desktop (above your repo folder), and access it through \\192.168.0.2\shareFolder\myrepo from your laptop.
Then only Git on your laptop would be needed.

Git Folder Path spelling Capitalization mismatch

I am new in git.
I am playing Tortoise git client on windows and it show path as small letter while it is in Capital letter for folder path.
Screenshot is as below.
as you can see path real path on Windows Iis as E:\HRIS\HRIS_Leave\Application\HRIS 3.5\SageFrame\Modules\HRISLeave\js but it must need to be shown as
Application/HRIS 3.5/SageFrame/Modules/HRISLeave/js
but it shows as
application/hris 3.5/sageframe/Modules/HRISLeave/js
i have other files on this directory too but they shown in path
Application/HRIS 3.5/SageFrame/Modules/HRISLeave/js
only LeaveRequest.js is on another folder on git but in disk it located on same folder.
how to resolve this issue or move this file to exact folder path.
See TortoiseGit issue #2559
and issue #1268
Could be a workaround: Do not set the Cache of Icon Overlay to Default, use the others.
Those issues are closed at Aug 18, 2015.

Creating SSH server on Windows for Mercurial

I'm struggling to find an answer for this, although it seems like such a common thing. Perhaps I'm approaching it from the wrong angle.
I would like to set up an SSH server so people can clone and push to a repository on a Windows machine. I.e.
hg clone ssh://bob#MY_COMPUTER/C:\repository
I've installed Bitvise SSH Server and have it set up and running and I am using TortoiseHG to manage the repository. I can connect via SSH to this computer: ssh bob#MY_COMPUTER. However, Mercurial seems unable to find the repository.
What am I missing? Do I need to set TortoiseHG up to start publishing the repository somehow?
Read carefully hg help url and eliminate all Windows-isms from URL
path is relative to the remote user's home directory by default. Use an
extra slash at the start of a path to specify an absolute path:
ssh://example.com//tmp/repository
I suppose, for Win-hosts absolute path will start from the root of drive with $HOME of connected user, but relative path is more predictable solution

Using and running Tortoise svnsync in Windows via command line

I have a local repository and I have just signed up to unfuddle and want to sync my local repository to the new one I have created on there.
I was told to run the following command:
svnsync init --username USERNAME http://username.unfuddle.com/svn/username-rep http://SOURCE_REPO_URL
Firstly, I assume I can remove the username stuff if the source repository doesn't require authentication?
Secondly, when I run that command my system doesn't recognize it. I assumed svnsync needed to be added somewhere in Windows so that it could be run via it's name only (think the correct term is an environment variable)?, but not only do I not know how to do that I don't know what program to add...... I cannot find any svnsync.exe or anything locate din my TortoiseSVN folder.
What do I need to do here?
When you install TortoiseSVN you are given the option to install the Subversion binaries as well:
Once you do that, you will see svnsync.exe in the installation folder:
As long as you have C:\Program Files\TortoiseSVN\bin in your PATH variable, you will be able to call svnsync.exe from the command-line:
(You can view your PATH variable thus (on Windows 7): Start -> right-click Computer -> Properties -> Advanced system settings -> Environment variables.... DO NOT overwrite whatever is there - simply append the path to TortoiseSVN if it isn't already there. More info here.)
Hope this helps.

Cannot get git extensions to push something to github SSH problems

Im trying to use git extensions and I really like it so far, but I don't manage to push to github. The following command works fine in git bash:
git push "origin" master:master
and then when I push with git extensions I get this:
C:\Program Files\Git\bin\git.exe push "origin" master:master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Done
In the git settings it just has openSSH selected which I would like to keep because putty seems more hassle.
The remote addres I have added in gitextensions, actually the only thing I have done from the bash just to test is the command above and gerenating the SSH keys. All else is set up in git extensions. So I suppose everything must be set up correctly. Eg, the email adress and name are correct...
ssh git#github.com
also connects fine, from bash
edit:
So I can reproduce the error by putting the command from git-extensions in cmd. Appearantly there is a difference between running from git bash and from cmd and git-extensions runs this command like a windows command... any clues?
update:
If I choose git-bash from the menu in git-extensions I get a window that is exactly the same as when I right click in explorer on my repo folder and choose git bash here. Now, in the one opened from explorer I can push and in the one opened from extensions I get the public key problem.
Things to check for:
Presence of HOME environment variable.
Presence of %HOME%\.ssh\ and RSA keys there.
When you run git from command promt it is preferred to run git.cmd, because it fixes HOME automatically:
#if not exist "%HOME%" #set HOME=%HOMEDRIVE%%HOMEPATH%
#if not exist "%HOME%" #set HOME=%USERPROFILE%
To fix gitextensions, define HOME variable and set it to same value as USERPROFILE
Ok, I solved it.
I opened the git bash from git extensions and a git bash using the explorer shell extensions. I then ran ssh -vvv git#github.com from both to see the difference.
It turned out that because I changed the location of the git config file ( I tend to reformat every now and then, so c:\documents and settings... is notoriously bad for storing anything I might want to keep persistent), when run from git extensions git was also looking for the ssh keys in a different location. So I added the .ssh folder where my git cofig file is and now it works fine. I think git-extensions sets the HOME variable for git to whatever you set as path for the config file.
Now, that was not obvious...
The correct answer is the one from 'max' (set your HOME env var manually), but it may help some to understand why the problem is happening (as Git gets more users around the world it's going to be very common).
Cygwin sets $HOME to /home/yourname, but that variable is not known in the Windows environment. So if you open a bash window and do env | grep HOME you'll see all three 'HOME' variables mentioned here, and you might wonder why Gitextensions doesn't use your proper cygwin HOME - which is because its .bat file invocation doesn't see it - it only sees what you see from doing 'set' in a windows console.
It's mystifying why it doesn't do this evaluation later and get the proper cygwin path since it knows how to invoke bash, but (at least in versions up to 2.41) you have to do this manual change in the settings or in .gitconfig.
When you fire up git bash directly you'll land in your home folder for MSYS. You need to make sure you have your ssh key (id_rsa ?) in the .ssh subfolder (relative to the home folder).
Glad you solved the problem. Since this sounds like a serious problem I'm interested in the difference between git-bash when started from GitExtensions. In GitExtensions there is a setting that might fix this. The %HOME% directory can be changed in GitExtensios. By default it will be set to %HOMEDRIVE%%HOMEPATH%, but you can override this. Changing this probably solves your problem, since you suggest this is the problem. To change this open the settings dialog and go to the tab "git". In the section "Environment" you can set the %HOME% path.
I will appreciate it if you let me know if this also solves the problem. I'm also interested in what caused this in the first place. Maybe I can improve the check for a valid HOME directory.
Yes, not setting the HOME varible was the issue for me too.
Set the HOME variable as %USERPROFILE% and regenerate the Private and Public keys, then try cloning—it should work now.
I see that the HOME variable is set to USERPROFILE in git extensions. I can add and commit but not push/pull from the remote repository. I am unable to connect to any remote repository. We use http (not ssh) for the connection. However, using git bash I am able to connect to the remote and do push/pull. I had put my issue GIT extensions does not connect to remote but git bash does and was directed to this issue. However, I am unable to resolve my issue. Any ideas?

Resources