Tag Archives: Git bash

git bash bash: *: command not found

 

Some functions of GIT bash installed by default are not available, such as zip. When executing zip and unzip commands under git bash, an error will be reported and the command cannot be found. Fortunately, we can install the commands we need. Take the zip command as an example, and the steps are as follows:

1. Open https://sourceforge.net/projects/gnuwin32/files/

2. Find zip and bzip2. Since zip depends on bzip2.dll, Download zip-3.0-bin.zip and bzip2-1.0.5-bin.zip. After decompression, copy zip.exe under bin directory of zip-3.0-bin and bzip2.dll under bin directory of bzip2-1.0.5-bin to & lt; Program folder>\ Git \ usr \ bin, such as mine:

                                                 

3. Then enter zip — help and unzip — help under git bash, which can be used as follows:

  Therefore, similar methods can be used for other commands

Reference: https://ranxing.wordpress.com/2016/12/13/add-zip-into-git-bash-on-windows/

[Solved] Git Bash error: could not lock config file Java/jdk1.7.0_71/.gitconfig: Permission denied

 

Git is installed for the first time today. It appears when it is configured according to the tutorial

$ git config --global color.diff auto
error: could not lock config file C:/Program Files/Java/jdk1.7.0_71/.gitconfig: Permission denied

After several attempts, solution :
find git installation directory, set the properties of git-bash.exe, and tick “run this program as administrator” on the compatibility property page

The following is a record of the course at that time:

When I first met this problem, I guessed that git needed administrator permission, so I asked which git was, and I looked where git was

$ which git
/mingw64/bin/git

Then add administrator rights to the properties of/mingw64/bin/GIT. Exe. Naively, I thought it was solved in this way, but the result was:

$ git config --global color.diff auto
bash: /mingw64/bin/git: Permission denied

So I thought that the program that calls git.exe needs administrator permission. But who calls git.exe?Also try to modify the permissions of/CMD/git.exe,/bin/bash.exe,/bin/git.exe, and still report the same error

When there was no way out, I suddenly found git-bash.exe in the GIT root directory. As soon as I saw it, I modified the permissions of git-bash.exe and found that the problem was solved! After removing the previous redundant permissions, there is still no problem

It is concluded that just setting the permission of git-bash.exe is enough

Git Bash Run “ssh-add pathName” Error: “Could not open a connection to your authentication agent.”

Recently, when I contacted laravel, I started using GIT and installed windows for GIT. When I pushed GitHub, I failed the verification. I didn’t add SSH to GitHub account

Follow the tutorial step by step to “SSH add pathname” and the following information will appear:

Most of Baidu said to execute Eval ‘SSH agent – s’ first. However, as shown in the figure above, it has already been executed, and it is still so. So continue with Baidu. Fortunately, we have finally found a solution

Solution: SSH agent is required to start bash, or to hang bash under SSH agent

[specific operation]:

way@DESKTOP-8CTQ9EA MINGW64 /d/XAMpp/htdocs/gitwork (master)
$ ssh-agent bash --login -i

way@DESKTOP-8CTQ9EA MINGW64 /d/XAMpp/htdocs/gitwork (master)
$ ssh-add
Identity added: /c/Users/way/.ssh/id_rsa (/c/Users/way/.ssh/id_rsa)

 

Win sudo plug-in solves the problem of GIT bash execution script error bash: sudo: command not found

Windows git bash has no sudo command by default. You can add win sudo plug-in to realize this function

curl -s https://raw.githubusercontent.com/imachug/win-sudo/master/install.sh | sh

If the above command doesn’t work, you can copy it https://raw.githubusercontent.com/imachug/win-sudo/master/install.sh Then bash install. SH is executed