Why is git slow on my windows machine? - windows

Just typing git at the command prompt (of powershell), takes 2.5 seconds until it returns with the help message.
I'm using the git for windows release, installed in C:\Program Files (x86)\Git. When I use cygwin (via babun), I get an error: Hint: your prompt is very slow. Check the installed 'BLODA' software. Maybe this is related? If it is, I'm using a corporate laptop, so can't uninstall antivirus or driver software, are there other options?

For me the reason seemed to be the "Inject ConEmuHk" setting in cmder under which I ran git. I've opened a bug https://github.com/bliker/cmder/issues/592

Try and see if the issue persists with the latest 2.4+ git for Windows release.
There is a bug related to the git bash startup time which is actively addressed.

Related

Recently updated to windows 10, just downloaded the lastest version of git but git-bash won't run on my windows 10

Recently, I updated my windows to version 10. Just installed the latest version of Git (2.27.0) but git-bash has refused to run after launching. Git-bash worked perfectly on my previous windows 7 but can't launch now. After clicking on the created Git-bash shortcut on desktop nothing happens. The other git tools Git-GUI and Git-CMD launches and works fine, only Git-bash doesn't. I've tried uninstalling and reinstalling git but still git-bash fails to launch. I've also gone through related articles here but can't solve this issue. I'm new to git so any help will be very much appreciated. I'm using a 32 bit OS.

Do I need to install Git for both Windows 10 and WSL?

I'm trying to set up a web development environment using a guide on Medium. The author says we need to install Git for both Windows and for Windows Subsystem for Linux. Git takes up a lot of space. Do we need to install it twice?
I have Visual Studio Code and Ubuntu (WSL). I also installed Git for Windows 10.
Git For Windows differs from the Linux Git.
So, if you want to execute commands in a Windows CMD and a Linux WSL shell, then yes, you would need to install both.
On Windows side, that can mean simply uncompressing the self-extracting archive PortableGit-2.22.0-64-bit.7z.exe anywhere you want, and add it to your PATH.

What is the difference between Bash and Ubuntu terminals on Windows 10

I recently installed Ubuntu for Windows and now inside the Start Menu there are 2 new items:
Bash
Bash
This terminal opens in:
root#myName-PC:/mnt/c/Windows/System32#
Ubuntu
Ubuntu
This terminal opens in:
root#myname-PC:~#
What is the difference between the two?
For example, we want to install Git and Utils, RVM (Ruby) then clone a Git project and deploy via SSH with Capistrano commands. Should that be run with Bash or Ubuntu as above?
Also, should the commands be run in system32 or C:/ folder when inside the terminal?
Thanks
The Bash terminal is the old style (prior to Windows 10 v1790 a.k.a. Fall Creator Update). It resides in %LocalAppData%\Lxss and is managed using lxrun.exe.
The Ubuntu terminal is the new style, downloaded from Microsoft Store. The launcher part is a Windows App (%ProgramFiles%\WindowsApp) and its data resides in %LocalAppData%\Packages.
Those are two isolated installation of Windows Subsystem for Linux and do not interfere with each other. Practically you need only one of them, so choose one at your own preference.
I personally dislike the Windows Store version as it can be easily removed, which isn't a good thing for a productivity environment.
I was trying to delete the legacy "Bash on Windows" and wasn't unable to because lxrun.exe is not available in my system. But in case anyone needs it, here's how:
If you wish, you can manually delete your legacy instance. This may be required if you encounter issues uninstalling the legacy distro using lxrun.exe, or are running Windows 10 Spring 2018 Update (or later) which do not ship with lxrun.exe.
To forcefully delete your legacy WSL distro, delete the %localappdata%\lxss\ folder (and all it's sub-contents) using Windows' File Explorer, or the command-line: (using PowerShell)
rm -Recurse $env:localappdata/lxss/
The git bash vs the Ubuntu bash.
Basically there is nothing much different except maybe the versions of the bash. Because bash is bash. It's most likely different versions of bash were installed at different times for different purposes on the PC. And they will also likely be found in different folders on the PC.
Run the following code from the two different shells. This returns the version of bash:
echo "$BASH_VERSION"
On this PC, using the two terminals (MinGW and Ubuntu) returned the following versions of bash: (see image link below)
5.0.17(1) - release
4.4.23(1) - release
It's likely most people using PCs that have been around a while will find that there are two (or more) different versions of bash installed on their PCs. On this PC, the older version of bash was installed some time back.
That older version of bash might have been installed when Cygwin was installed on this PC. Or maybe the older version of bash was installed when Git was installed long ago. It really doesn't matter now. On this PC, bash is found in at least these following locations:
C:\cygwin64\bin\bash.exe
C:\Program Files\Git\bin\bash.exe
C:\Program Files\Git\git-bash.exe
The Windows 10 on this PC was updated. Specifically, the WSL kernel was updated from WSL to WSL2. Part of this update involved turning on some Windows features, including the: Windows Subsystem for Linux.
There was an old (virtual) version of Ubuntu (18.04) that had been installed on this PC some time back. But that old version of Ubuntu went away with this update. This WSL2 update changes the way Linux (Ubuntu) operates on this PC. After the WSL2 update, Ubuntu was installed from the Microsoft Store. This is Ubuntu 20.04.
This WSL2 update and the newly installed version of Ubuntu also installed a newer version of bash on this PC. And this newer version of bash is the newer version of bash that is showing above.
Another good way to understand the difference between these two versions of bash would be to enter the following into each shell:
type ping
The result should clearly show that one version of bash is providing the source from Windows while the other version of bash provides the source from Ubuntu.
ping is /c/windows/system32/ping
ping is /usr/bin/ping
Sometimes a picture is worth more than a thousand words. Attached below are two of the new Windows Terminals side by side.
These terminals show the two different versions of bash. Echo returns the older version of bash being used in the MinGW shell and Echo returns a newer version of bash being used in the Ubuntu shell.

Not seeing latest version when updating Node.js via installer (MSI) Windows 7

I'm trying to update node on my Windows 7 box but I'm not seeing the latest version after I re-install/update node.
I'm just going out to http://nodejs.org/download/ and getting the latest Windows installer, v0.10.28. I then just run that installer where it defaults to installing everything on my local hard drive, including npm, which is cool because I wanted to upgrade that as well.
Install runs/finishes with no apparent problem, but when I do a:
node --version
I'm still seeing my "old" version, v0.10.15, not the latest I supposedly just installed, v0.10.28. My npm version still reports my "old" version as well.
I've tried rebooting as well.
How the heck does one update node/npm?
I had a similar problem but on MacOS and the reason was I had nvm installed. So running the commands found on most websites:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
didn't work, node -v still displayed the old version.
What I did was to install node from nvm:
nvm install v0.12.6
This will build node from scratch on your machine, and then node -v will display the correct version. I think I could have still used the previous commands by using n and then do nvm use v0.12.6, but this is something to test. If you have nvm installed, just check the commands for nvm to upgrade node.
Answer given by Johan Dettmar about using n will work here as well.
For Windows : open command prompt as administrator
For Linux/Mac : sudo -s on terminal
npm cache clean -f (force) clear you npm cache
npm install -g n install "n" (this might take a while)
n stable upgrade to lastest version
Windows Users
Node is most likely installed in 2 locations.
C:\Program Files\nodejs
C:\Program Files (x86)\nodejs
Rename the folder of the (x86) version to "nodejsOLD", restart command prompt, and try again.
node -v
The installer works just fine, things you do NOT need to do:
You do NOT need to uninstall
You do NOT need to reboot
There is a good discussion for Windows and node on stack overflow here:
How do I update npm on Windows?
I had this exact same problem, and one thing to be careful about is to make sure you are downloading the correct architecture version (e.g. 32-bit or 64-bit). When upgrading, I had downloaded the 32-bit version and didn't realize it. But the previous version I had installed was 64-bit. So I actually ended up with a 32-bit and 64-bit version installed. But when you go to do an uninstall, it only lists one version of node.js, so even after I uninstalled, it uninstalled the latest version, but kept the earlier version on there. That's why I kept getting the old version when I did "node -v".
Once I downloaded the correct version (64 bit in my case), the problem was resolved.
A tip that might be useful for others, I found it helpful to known for Windows platforms.
Enter the command in cmd.exe:
where node
This outputted for me that node.exe was in a subdir of Chocolatey.
Problem was that this version was v8.11.1 and it did not work with newer version of the Angular-CLI. So I removed the exe and then ran the installer of the LTS version of Node on Nodejs website to get a working version of Node for Angular. Tested out on Windows 10.
So if you are on Windows, test out the where command in cmd.exe
Linuxers and Mac-ers can use other commands, such as which command.
Screen shot below. I deleted the node.exe file before running the node.exe command.
To fix this problem you can modify your "Environment Variables".
From "System Properties" open the "Environment Variables".
In the system variables section select the path variable and click on the edit button.
In this list you must have the latest folder of installed Node.js(delete other Node.js folders from the list).
That's it
To update Node, download the latest http://nodejs.org/dist/latest/node.exe (or http://nodejs.org/dist/latest/x64/node.exe for 64bit systems) and replace your old node.exe with it.
To update npm, run the npm update npm -g command.
Even though it might sound stupid, make sure you did not previously have node version managers installed which you no longer use, such as Nodist. These will allow the machine to only have their internal node version as the usable version and not the one you install yourself manually.
Uninstalling these package managers, if you want to manually update your Node/NPM versions, will solve the issue.
I had the same problem - but it was caused due too duplicated versions of nodejs being set in my environmental variables.
You can easily check that in Windows using where node in cmd. If more than one path is being output that might be the reason for this error. You can fix it by removing the other environmental variables.
I had the same problem in Windows 10 and none of the above recommendations worked. Then I closed the terminal window, restarted it and the correct version now showed, and the subsequent version errors running other commands also went away. Seems that the version loaded by Windows PowerShell is stuck until the terminal is relaunched. Clearing the cache via command line was futile.
Seems simple and dumb, but that resolved it for me (in the sense that it probably was resolved in the background but I couldn't see the resolution take effect until the terminal was reloaded). Hope this helps someone else.
Using where node, worked for me. That showed me that I had node in the heroku directory as well and since I won't be using that CLI anytime soon, I just removed that dir from the 'path' 'system variable'.
You can fix this on Windows by following these steps if you have already installed nodejs latest version but that is not showing/working.
Open Cmd type where node it will give you a path (like in the
attachment)
Go to that location and delete the node application
exe file
and then come back and try to check that's all you are done , that was the issue of path, your system was using the old reference

Reasons why git is not visible to Rstudio (OSX)

I have been trying for a few hours to use git within Rstudio on my macbook. However, the option to use git within version control is missing - the only option remains (none).
I have installed github, and then git directly, using the link given
in the rstudio website.
I have attempted to run the bash script
supplied with the git installation file.
I have verified that git is
active on the machine through both github and directly through the
command line.
I have located the git file in the hidden folder
/local/git/bin/git
and pointed Rstudio to this using global options.
I have reinstalled git a couple of times.
I have logged off and on again multiple times.
Any solutions very welcome.
Thanks,
Jon
The same just happened on my mac. I narrowed down the issue to the Xcode developers package update. The fix in my case was:
From a shell go to /usr/bin
sudo ./git
Agree to the terms
Close and reopen RStudio
VoilĂ . Git has returned to RStudio.
My RStudio git tab disappeared after upgrading to OS X El Capitan. I tried following the advice in the top answer:
but I got the error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
which led me to discover I had to reinstall XCode command-line tools. I did this via:
xcode-select --install
I also updated to latest release of RStudio. Then my git tab reappeared.
I just came across your question after I encountered a similar issue on windows. You've probably sorted yourself by now but just to let you & others know what worked for me.
From RStudio Tools, Global Options.
Option for Git Executable.
Browsed to git.exe in the git/bin folder.
Now working like a dream.
Andy
It's now working. As expected it took re-installing the operating system, as well as the following:
http://blog.rstudio.org/2013/10/22/rstudio-and-os-x-10-9-mavericks/
Using the preview version available from the link below solved the Rstudio/Git issue instantly.
Same issue with OSX High Sierra
This answer in this thread on GitHub helped me
In short, OSX seems to use another directory for the git file

Resources