Can the credentials stored in Github for Windows be shared with the whole operating system?
Asked Answered
S

1

1

Is it possible to share GHfW's Git configuration with the entire operating system? Ideally I'd like to have GHfW's git.exe on the system PATH and have the credentials stored through GHfW available from any command prompt?

Spiny answered 8/11, 2012 at 11:24 Comment(5)
As far as I’m aware, GitHub for Windows is built only with libgit2 and as such does not come with a git.exe executable. So you cannot do this, you’ll have to install Git for Windows separately.Hajj
@Hajj it has portable git in C:\Users\Greg\AppData\Local\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7Spiny
Ah, good that I didn’t write it as an answer ;) Can’t you just add its bin (or cmd if that exists) to your PATH?Hajj
I could, but the hash in the folder name suggests it's might chnage when GHfW updates. I was looking for a permanent solution.Spiny
Well, the permanent and more stable solution would be to just install Git yourself.Hajj
J
1

By default, GitHub For windows will use %USERPROFILE% as its %HOME% to store:

  • .gitconfig (global config for all repos)
  • .ssh/github_rsa (private key used by GitHub for Windows for authentication)*
  • .ssh/github_rsa.pub (public key used by GitHub for Windows for authentication)

If you are working outside of GitHub for Windows, and git local installation will benefit from the same settings provided the %HOME% is defined to the same %USERPROFILE% environment variable path.

However, there is no easy way to use (actually find) its wrapped git version:
GitHub for Windows only exposes a wrapped msysgit in %APPDATA%\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7\cmd\git.exe,
with 8810fd5c2c79c73adcc73fd0825f3b32fdb816e7 being the SHA1 of a github/msysgit project.
It uses internally the environment variable %git_install_root%.

You can grep its path in %USERPROFILE%\Local Settings\Application Data\GitHub\shell.ps1 though.

Joletta answered 8/11, 2012 at 14:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.