question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option during install to add git to path in Windows

See original GitHub issue

Description

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

  1. Add C:\Users\user\AppData\Local\GitHubDesktop\app-1.0.11\resources\app\git\cmd to path

image

  1. You can now use git provided by desktop via powershell, cmd and even in Visual Studio Code

image

image

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?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
shiftkeycommented, 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:

  • 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 https://github.com/Microsoft/vscode/pull/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.

0reactions
gliatraxcommented, Mar 21, 2019

Thank you. This was helpful. saved to re-read for later configurations as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add Git to PATH on Windows - Linux Hint
To add Git to the PATH environment variable on Windows, open up the “Edit Environment Variable” app, choose the “Path” option underneath the...
Read more >
How to add GIT to windows PATH environment variable
Steps to set Windows PATH Environment Variables for GIT. ... Next, click on "New" button and add the following two paths C:\Program Files\Git\bin\...
Read more >
Add Git to PATH on Windows | Delft Stack
Navigate to the System Properties on Windows · Edit Environment Variables to Add Values to the PATH Variable · Run the git Command...
Read more >
How to install GIT on your Windows machine? - SiteGround KB
On the next step, you should choose where to install the program. The default path is “C:\Program Files\Git“. If you want the software...
Read more >
Installing and Configuring Git for Windows - YouTube
In this video, I show Windows users how to install and configure Git for Windows. Specifically, I demonstrate:How to configure your PATH ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found