git Github桌面在哪里安装命令行版本的Git
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34565238/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does Github desktop install command line version of Git
提问by user310291
According to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
根据https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
The installer includes a command line version of Git as well as the GUI. It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.
安装程序包括一个命令行版本的 Git 以及 GUI。它还适用于 Powershell,并设置可靠的凭据缓存和健全的 CRLF 设置。
When I'm launching the latest download from https://desktop.github.com/, it just runs immediately and does not offer me to install command line version. I checked in cmd by typing git, command is not recognized.
当我从https://desktop.github.com/启动最新下载时,它会立即运行,并且不会让我安装命令行版本。我通过键入 git 签入了 cmd,无法识别命令。
Do GithubDesktop really installed Git command line, if not can I force it to do so somehow ?
GithubDesktop 是否真的安装了 Git 命令行,如果没有,我可以以某种方式强制它这样做吗?
Update: I've found the install but cannot access it from Powershell.
更新:我找到了安装,但无法从 Powershell 访问它。
采纳答案by darkomen
GithubDesktop install a Git shell with their desktop application. It seem to be locate in a same directory than their RIA application.
GithubDesktop 使用他们的桌面应用程序安装 Git shell。它似乎与他们的 RIA 应用程序位于同一目录中。
If you have a shortcut created by installer GitHubDesktop you can retrieve the git shell location.
如果您有安装程序 GitHubDesktop 创建的快捷方式,您可以检索 git shell 位置。
回答by Pondersome
On Windows the latest Electron / unified versions of github desktop has git stored here:
在 Windows 上,最新的 Electron / 统一版本的 github 桌面将 git 存储在这里:
C:\Users\UserName\AppData\Local\GitHubDesktop\app-1.0.5\resources\app\git\cmd\git.exe
回答by Brendan Forster
GitHub Desktop team member here
GitHub 桌面团队成员在这里
Do GithubDesktop really installed Git command line, if not can I force it to do so somehow ?
GithubDesktop 是否真的安装了 Git 命令行,如果没有,我可以以某种方式强制它这样做吗?
We no longer support the "Git Shell" environment you might be thinking of, as we decided to focus our resources on the GUI experience. You can read the discussion and why we decided to drop support here: https://github.com/desktop/desktop/issues/340
我们不再支持您可能想到的“Git Shell”环境,因为我们决定将我们的资源集中在 GUI 体验上。您可以在此处阅读讨论以及我们决定放弃支持的原因:https: //github.com/desktop/desktop/issues/340
If you want a command line Git experience on Windows, Git for Windowsis your best bet.
如果您想在 Windows 上获得命令行 Git 体验,Git for Windows是您最好的选择。
回答by Jesper Risager
If you are looking for the command line version of GIT with powershell and not CMD prompt like I was then this might help you.
如果您正在寻找带有 powershell 的命令行版本的 GIT 而不是像我一样的 CMD 提示,那么这可能对您有所帮助。
Github Desktop was changed from Chocolate-Covered Yaks (newest version 3.3.4.0) to a new native desktop which was redesigned with Electron. (It uses git version 2.11.0.windows.3)
Github 桌面从 Chocolate-Covered Yaks(最新版本 3.3.4.0)更改为使用 Electron 重新设计的新原生桌面。(它使用 git 版本 2.11.0.windows.3)
Unfortunately the new Github Desktop does not (yet) include a right click option to start PowerShell, like the old version did.
不幸的是,新的 Github 桌面(还)没有像旧版本那样包含用于启动 PowerShell 的右键单击选项。
So if you are stuck with the old Github Desktop Chocolate-Covered Yaks because you like the powershell option and you want to upgrade to a newer version of GIT, then you should look for a folder like this:
因此,如果您因为喜欢 powershell 选项而坚持使用旧的 Github Desktop Chocolate-Covered Yaks,并且想要升级到更新版本的 GIT,那么您应该查找如下文件夹:
Example: C:\Users{Your UserName}\AppData\Local\GitHub\PortableGit_{hex code which changes}\cmd (Example is for windows 7. For windows 10 I believe it is using \bin as folder name instead of \cmd
示例:C:\Users{Your UserName}\AppData\Local\GitHub\PortableGit_{更改的十六进制代码}\cmd(示例适用于 Windows 7。对于 Windows 10,我相信它使用 \bin 作为文件夹名称而不是 \cmd
The folder contains git.exe.
该文件夹包含 git.exe。
Note this is a DIFFERENT folder placement than the new version of Github Desktop uses, which is why im adding this as an extra answer.
请注意,这与新版本的 Github Desktop 使用的文件夹位置不同,这就是我将其添加为额外答案的原因。
I thought I could just replace git.exe with the newest version of git, but when I do that I get
我以为我可以用最新版本的 git 替换 git.exe,但是当我这样做时,我得到了
Git version
"error launching git: The system cannot find the path specified."
Git 版本
“启动 git 时出错:系统找不到指定的路径。”
What in the end worked for me was to simply delete the git.exe from the PortableGit_{hex code which changes}\cmd folder.
最后对我有用的是简单地从 PortableGit_{hex code which changes}\cmd 文件夹中删除 git.exe。
Since I had installed the Git separately in the newest version, it seems to default back to that and I get
由于我在最新版本中单独安装了 Git,它似乎默认回到那个,我得到
Git version
git version 2.17.0.windows.1
Git 版本
git 版本 2.17.0.windows.1
Note that if you delete the git.exe, Github Desktop v3.3.4.0 will stop working and the only thing you can use it for is to open the shell. For me thats perfect as I use the new Github Desktop anyways for anything but opening the shell.
请注意,如果您删除 git.exe,Github Desktop v3.3.4.0 将停止工作,您唯一可以使用它的就是打开外壳。对我来说这是完美的,因为我使用新的 Github 桌面除了打开外壳之外的任何事情。
I also wanted to change editor. It is NOT enough to just install the new version of git and select notepad as editor. Somehow the powershell opened by the old Github Desktop still had its core.editor set to vim.
我也想换编辑器。仅仅安装新版本的 git 并选择记事本作为编辑器是不够的。不知何故,旧的 Github 桌面打开的 powershell 仍然将它的 core.editor 设置为 vim。
I fixed it by typing the following in the power shell:
我通过在电源外壳中键入以下内容来修复它:
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
回答by Simon Sessler
Goto Preferences an choose your Git-Shell. Thats it. Under default Shell you can choose between: CMD, Git Bash, Powershell or Custom.
转到首选项并选择您的 Git-Shell。就是这样。在默认 Shell 下,您可以选择:CMD、Git Bash、Powershell 或自定义。
回答by Akshay Vinchurkar
git wants to simplify things so if you don't confortable with command line interface then you try git desktop if you want both command line and desktop GUI then install separate git from This URl https://git-scm.com/
git 想要简化事情,所以如果你对命令行界面不满意,那么你尝试 git desktop 如果你想要命令行和桌面 GUI,然后从这个 URl https://git-scm.com/安装单独的 git