Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

git - Can the credentials stored in Github for Windows be shared with the whole operating system?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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%GitHubPortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7cmdgit.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 SettingsApplication DataGitHubshell.ps1 though.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...