You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add option during install to add git to path in Windows #3708
Enhancement request. Add an option during install on Windows to add git provided by desktop to path. This will allow users to also use git from the command line. Also, it will satisfy Visual Basic Codes git check and will allow version control using git.exe provided by desktop from Visual Basic Code.
Current Setup
GitHub Desktop version: 1.0.11
OS: Windows 10 Pro
OS version: Microsoft Windows [Version 10.0.16299.125]
Steps to Reproduce
Add C:\Users\user\AppData\Local\GitHubDesktop\app-1.0.11\resources\app\git\cmd to path
You can now use git provided by desktop via powershell, cmd and even in Visual Studio Code
Additional Information
I'm sure this wouldn't be something everyone wants as you can always install the actual git for windows, but that comes with some config choices. I know I would rather just install desktop to get git functionality in Windows. Since this is something not everyone would want, I'm thinking the best way to implement this would be via adding a checkbox option during install. Something along lines of add git to path.
Not sure this would really make sense on Linux or macOs. Thoughts?
The version of git we bundle has many features removed so we can have a smaller download size. This makes it a poor candidate for use outside of Desktop, since we might remove features of git we don’t use at any time without warning.
@gmcclins thanks for the suggestion. We made a conscious decision back in the early days of GitHub for Windows to not tamper with your existing environment unless absolutely necessary, and this is one of those cases.
While it seems convenient to do this, it actually introduces a whole lot of problems:
the path to our embedded version of Git is tied to the specific version of Desktop - whenever an update is applied, this path will change, leading to potential breakage of anything that is hard-coded to that path (like environment variables)
the embedded version of Git we use in Desktop doesn't support terminal features like colorization, pagination and the UNIX toolchain that developers are familiar with, because we want to save space and we don't need them in the app
Desktop manages its own credentials using the GIT_ASKPASS environment variable (details here), and simply adding Git to your PATH won't get credentials working in your terminal or app
we discourage depending on our version of Git because it's never been officially supported, and how we embed Git is subject to change. An example of that is VSCode. Early on they took a dependency on the Git found in GitHub for Windows for convenience, and this worked okay until you also installed the Electron Desktop version (we support using these side-by-side) which had it's own CLI integration. This combination broke VSCode because they didn't manage the PATH environment variable correctly, and it would continually spawn the Desktop UI. I had to get them to remove this code in disable lookup for GitHub's version of Git microsoft/vscode#35965
We recommend installing Git for Windows and ensuring you check the "add to your PATH" option in it's installer, as both Desktop and VSCode interop nicely with that.
Reacted by Chris Goes, Benjamin McIntire, Saborknight, Dmitri Shuralyov, Robert Oostenveld, orbitrod, Feranmi Akinlade and Robert Saramet
I can manually add the path of the git.exe from bin folder and it is working in cmd.exe commands but not by default. There is an option to select the shell in the settings too but all is not working. Why put something that is not working??? Please update or remove the option...
@amjadtbssm we don't recommend adding the Git that ships with GitHub Desktop due to it being customized for the app. The shell option in the menu is explicitly to set the shell you want to open from within GitHub Desktop. I hope that helps explain things.
Activity
j-f1 commentedon Jan 1, 2018
The version of git we bundle has many features removed so we can have a smaller download size. This makes it a poor candidate for use outside of Desktop, since we might remove features of git we don’t use at any time without warning.
shiftkey commentedon Jan 1, 2018
@gmcclins thanks for the suggestion. We made a conscious decision back in the early days of GitHub for Windows to not tamper with your existing environment unless absolutely necessary, and this is one of those cases.
While it seems convenient to do this, it actually introduces a whole lot of problems:
GIT_ASKPASSenvironment variable (details here), and simply adding Git to yourPATHwon't get credentials working in your terminal or appPATHenvironment variable correctly, and it would continually spawn the Desktop UI. I had to get them to remove this code in disable lookup for GitHub's version of Git microsoft/vscode#35965We recommend installing Git for Windows and ensuring you check the "add to your
PATH" option in it's installer, as both Desktop and VSCode interop nicely with that.j-f1 commentedon Jan 1, 2018
Would it be possible to / should I open an issue for printing out a warning if you attempt to use the integrated git outside of Desktop?
shiftkey commentedon Jan 1, 2018
@j-f1 nah, I don't think the effort required to do this is worth it
gmcclins commentedon Jan 1, 2018
Thank you for the review and taking the time to explain in detail.
gliatrax commentedon Mar 21, 2019
Thank you. This was helpful. saved to re-read for later configurations as well.
Удалить GitHub Desktop из разделов «Установка Git»
amjadtbssm commentedon Jul 13, 2024
I can manually add the path of the git.exe from bin folder and it is working in cmd.exe commands but not by default. There is an option to select the shell in the settings too but all is not working. Why put something that is not working??? Please update or remove the option...
steveward commentedon Jul 17, 2024
@amjadtbssm we don't recommend adding the Git that ships with GitHub Desktop due to it being customized for the app. The shell option in the menu is explicitly to set the shell you want to open from within GitHub Desktop. I hope that helps explain things.