Some git commands are slow on Windows 10 - windows

git status, git branch and git log for example are running slow when I issue the commands from a regular privilege powershell.
However, if I run the powershell prompt with admin privileges and I run the above commands, they execute quickly without any issues.
Any thoughts please?

Adding git.exe as a process exclusion didn't work for me, but adding C:\Program Files\Git\* (also as a process exclusion) solved my issues.
After that, git pull and fetch went from 100 secs to 3 secs in Git Bash, PS and SourceTree.

Related

Jenkins, git 'advanced' commands (fetch, diff etc) and ssh-agent (Windows Server)

We have x86 Jenkins running on Windows Server 2016. No issues with pull of repo over ssh, both for projects and with git plugin in the pipeline.
Now I would like to be able to execute a 'git diff' command after a fetch from origin. I installed the Jenkins plugin "sshagent" and am attempting to execute the git commands from that context. From that plugins page it appears I no longer need to use Tomcat Native Libraries (quote: As of 1.14 unnecessary if ssh-agent is installed)
My direct issue is the error "Check if ssh-agent is installed and in PATH". I would prefer not to use Tomcat version if possible. I suppose I am trying to understand why every search I do implies ssh-agent.exe should be part of git, but it is not in my 'bin' folder.
Open to other ways to accomplish the stated goal (execute git diff), including foregoing ssh connection to the git server, but that also looks to be not straightforward.
This ended up being fairly straightforward, ssh-agent.exe was in git/usr/bin not git/bin. adding it to path per Druta suggestion resolved

git commands and install freeze git bash won't open

Installing git ver 2.15.0 and 2.14.2 on Windows 10 freezes before finishing the install. The only way to close the install window is to kill the process or restart my machine.
After restarting, git Bash will open but it opens in a frozen state. If I try to run commands from an Admin Windows command prompt, some of them work but git push and git stash also just hang there, and do nothing.
I've search around and have found that others have problems with git on Windows 10 but haven't found any solutions.
Any suggestions or is there any type of error logging with git?
Thanks

Push From Git Bash to Heroku

I want to push a project I created to Heroku from Git. I'm running windows and have the Git Bash shell installed as well as the Heroku CLI. Running this from Git Bash shows my Git version:
$ git --version
git version 2.14.1.windows.1
However, when I try from that same Git Bash shell to create my application on Heroku as a remote Git repo, I get an error:
$ heroku create
bash: heroku: command not found
So instead I created my application on Heroku from a regular windows cmd terminal and that worked (i.e., when I log into heroku I see the remote repo). But when I try to do a git push from the windows cmd terminal it does not recognize git:
C:\myapp>git push heroku master
'git' is not recognized as an internal or external command,
operable program or batch file.
Whereas when I try to do a git push from the git bash shell, I get this error indicating perhaps it doesn't know what to make of heroku:
$ git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
So it seems my regular windows cmd terminal recognizes heroku, but my Git bash terminal does not. How do I configure Git bash to recognize the Heroku command?
Note: When I do a env | grep path from the Git bash shell the results do include my C:/Program Files/Heroku/bin directory, so Git is aware of my Heroku path.
Your problem is not that git would not push to heroku, but that you actually haven't installed git on your system, as the message you posted suggests.
'git' is not recognized as an internal or external command,
operable program or batch file.
At heroku's documentation there is a whole article about pushing to git, if you experience further problems after installing git, you might find a solution there.
Found a solution! It required the following 3 steps/considerations:
First, I followed john g's answer here, which is to close Git Bash and login to Heroku via a windows cmd terminal, then use Git Bash as per normal.
Second, when issuing a heroku command from Git Bash on Windows, include the extension, as described here. I.e., issue heroku.cmd create (instead of just heroku create).
Third, apparently the git push heroku master command must be issued from the same Git Bash terminal where you just issued heroku.cmd create. When I had issued it from a separate terminal I got an error saying "'heroku' does not appear to be a git repository".
I'm posting this, in hopes that it may help others and save them the same trouble I had. This was driving me mad and I tried every solution I could manage to find on the issue. Spent several hours trying to trouble-shoot it. What it actually ended up being was a conflict with my internet security, specifically Comodo Internet Security Premium 10. I received no warning, it just automatically added it to a blocked list on first execution. If you are running internet security software, especially on a Windows machine, this very well could be your issue. Remove the command file found at C:\Users\YOUR_USER_NAME\AppData\Local\heroku\client\bin\heroku.cmd from any block list, as well as any other executables from heroku that may be on the list.

Jenkins not playing nice with a private GitHub repository (Windows)

I cannot for the life of me seem to get my Jenkins CI to work with Github.
I had failure on the clone command, but that was due to keys, so I logged in as service account (the user Jenkins runs under as a Windows Service) and ran the clone command. All good in the hood.
However, when I want to run the fetch to get latest, it won't finish. It just sits there. I have tried via the Git plugin for Jenkins, and also via a Windows commandline script. Neither work. However, if I open a command prompt and type the command in, it works!
So how do I get it to work via Jenkins?
I run this script:
set
"C:\Program Files (x86)\Git\bin\git.exe" fetch -t ssh://git#github.com/OrgName/MyRepo.git +refs/heads/*:refs/remotes/origin/*
exit 0
and it sticks on the fetch command, never exiting.
Does someone have any suggestion?
It looks like msysGit stuck trying to find one of its components, used during fetch operation.
The Git itself not a single executable actually. It's a set of small tools doing their job great only being put together. Running Git on Windows from bash prompt makes it happen, but when you're running via Windows command prompt or in batch-files, the Force may not be with you.
I think you should check wherever you installed msysGit with option "Run Git from Windows Command Prompt". In this case all needed parts of Git will be added to the system PATH variable and git.exe will be able to access it from batch files, thus it should fix your fetch statement.

Hudson git commands are *incredibly* slow

I have installed msysgit, and I am attempting to use it inside of Hudson. Whenever I run a command in an interactive shell, whether it be git-bash or a command prompt, the commands are instant. When I run them in Hudson, they lag for a very long time.
Running /bin/git help took 63 seconds when I just invoked it. I've never waited long enough to see a clone begin outputting (>10 minutes).
The Hudson mailing list is down, so I figured I would try here...
I've run into this problem as well, and figured out a workaround. When Hudson runs as a service, something is missing that your normal desktop environment has, which causes something to do with the network to have to re-load for each process. msys-1.0.dll attempts to load something in netapi32.dll which causes it to take so long. So I just downloaded plink.exe from PuTTY, and set my GIT_SSH env to use that instead. Problem averted.
Have you tried using the Git plugin for Hudson?

Resources