What is the exact meaning of Git Bash?

git bash is a shell where: the running process is sh.exe (packaged with msysgit, as share/WinGit/Git Bash.vbs) git is a known command $HOME is defined See “Fix msysGit Portable $HOME location”: On a Windows 64: C:\Windows\SysWOW64\cmd.exe /c “”C:\Prog\Git\1.7.1\bin\sh.exe” –login -i” This differs from git-cmd.bat, which provides git commands in a plain DOS command prompt. A … Read more

Set an environment variable in git bash

A normal variable is set by simply assigning it a value; note that no whitespace is allowed around the =: HOME=c An environment variable is a regular variable that has been marked for export to the environment. export HOME HOME=c You can combine the assignment with the export statement. export HOME=c

How to add man and zip to “git bash” installation on Windows

Here’s another, slightly different, set of instructions to install zip for git bash on windows: Navigate to this sourceforge page Download zip-3.0-bin.zip In the zipped file, in the bin folder, find the file zip.exe. Extract the file zip.exe to your mingw64 bin folder (for me: C:\Program Files\Git\mingw64\bin) Navigate to to this sourceforge page Download bzip2-1.0.5-bin.zip … Read more

OpenSSL hangs during PKCS12 export with “Loading ‘screen’ into random state”

Please try to add winpty before oppenssl: winpty openssl … or you can run a new bash wrapped by winpty: winpty bash In the windows console, there is some problem with terminal input/output so winpty can help if some software requires unix terminal behavior. winpty helped me to run openssl in this environment: git version … Read more

Git Bash doesn’t see my PATH

Got it. As a Windows user, I’m used to type executable names without extensions. In my case, I wanted to execute a file called cup.bat. In a Windows shell, typing cup would be enough. Bash doesn’t work this way, it wants the full name. Typing cup.bat solved the problem. (I wasn’t able to run the … Read more

How to iterate through all git branches using bash script

You should not use git branch when writing scripts. Git provides a “plumbing” interface that is explicitly designed for use in scripting (many current and historical implementations of normal Git commands (add, checkout, merge, etc.) use this same interface). The plumbing command you want is git for-each-ref: git for-each-ref –shell \ –format=”git log –oneline %(refname) … Read more