git-bash

Executing Command with “cmd” That Contains Spaces Through Git-Bash?

六眼飞鱼酱① 提交于 2021-02-08 08:46:22
问题 I'm trying to execute a command with git-bash using cmd. I need to pass the command for it to execute. The problem is I need to pass the path of the batch file into the command and it has spaces. I can't seem to be able to pass quotes to "cmd" in a way that it will understand it. cmd //C "c:\Program Files (x86)\another path\file.bat args && echo done" That will give me an error: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. If I try using

Bash script check string for uppercase letter

亡梦爱人 提交于 2021-02-04 18:09:05
问题 I am trying to check a string for any Uppercase letter. my code shows NO UPPER for any input, may it be "sss", "Sss", "SSS" if [[ "$pass" =~ [^a-zA-Z0-9] ]] then echo "Upper found" else echo "no upper" fi 回答1: [^a-zA-Z0-9] means anything except for a-z , i.e. lowercase letters, A-Z , i.e. uppercase letters, and 0-9 , i.e. digits. sss , Sss , SSS all contain just letters, so they can't match. [[ $password =~ [A-Z] ]] is true if the password contains any uppercase letter. You should set LC_ALL

How to fix “unable to find Git in your path ” error , despite providing required path

半世苍凉 提交于 2021-02-04 16:44:34
问题 Whenever i try to run a flutter command (in cmd), the following error occurs : 'where' is not recognized as an internal or external command, operable program or batch file. Error: Unable to find git in your PATH. I found the similar error here How to solve "Unable to find git in your PATH" on Flutter? and tried everything things I've done: included all essential git paths i.e. C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32 (did the above step many times ,

How to write the following script in Powershell

你说的曾经没有我的故事 提交于 2021-01-29 18:55:22
问题 This question is related to: bash: C:/Program: No such file or directory What is the equivalent syntax to write the following in Powershell so that I can run this on Windows 10 without any problems? export DEBEZIUM_VERSION=1.1 docker-compose -f docker-compose-sqlserver.yaml up cat debezium-sqlserver-init/inventory.sql | docker exec -i tutorial_sqlserver_1 bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD' curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json"

mkdir doesn't work when I'm in my documents, but does work when I'm in C:/

时间秒杀一切 提交于 2021-01-29 08:17:34
问题 I tried to make a new folder using de mkdir command in Git Bash mkdir PetStore and I get mkdir: cannot create directory ‘petstore’: No such file or directory And the only solution I find online is that I have to use -p because the parent directory doesn't exist, but it does. Doing this same command within C:\temp\ does work. So I'm assuming the problem has something to do with permissions. What am I doing wrong? note: Git Bash was running as administrator edit: I'm using windows 回答1: If

Updating a running bash file

▼魔方 西西 提交于 2021-01-28 05:44:48
问题 I have the following function in a bash script. Let's call this script example.sh . It's inside a git repository that should update. example.sh (simplified version) # Directory of script dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" update() { ( cd "$dir" && git pull ) } if [ "$1" == "update" ]; then update fi Then I call example.sh update (which calls the function) so it executes the git pull . Now the issue is when there's a change in example.sh , it needs to

Fixing mac/windows new lines with git pre-commit hook?

流过昼夜 提交于 2021-01-24 07:12:19
问题 In our office we working in a team of about 10 developers. Most of them have a Mac machines. Recently I've realise when I'm checking differences of my work (after changing only one line of code) almost each line is changed, but git diff shows you change is exactly same as original. After some research it's turned out to be a different new line. Before I do anything it's '\r\n' (CR+LF, 0x0D0A) and after my change all non Unix new lines (\r\n) are change to Unix one (\n). I realize I could ask

Git Init in home directory - now unable to commit changes

孤者浪人 提交于 2021-01-20 12:41:07
问题 Git noob here, it's my first try with git on bash, and I did git init in my home directory. I realised that was wrong and then used rm -rf $HOME/.git to undo it. Now when I try to commit changes in another directory called git-practice, it says branch master and won't commit any files I have added to the staging area. When I try git add, the following comes up in the terminal: On branch master Initial commit Untracked files: (use "git add ..." to include in what will be committed) README.txt

How can I use git bash aliases in vscode terminal?

余生长醉 提交于 2021-01-01 07:03:32
问题 I have several git bash aliases that work fine when I use the git bash terminal, but they dont when I use the vscode integrated terminal? Is there a way to fix this? I do have bash selected in vscode. After running git config -l --show-origin --show-scope system file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl system file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt system file:C:/Program Files/Git/etc/gitconfig

How can I use git bash aliases in vscode terminal?

只谈情不闲聊 提交于 2021-01-01 07:02:32
问题 I have several git bash aliases that work fine when I use the git bash terminal, but they dont when I use the vscode integrated terminal? Is there a way to fix this? I do have bash selected in vscode. After running git config -l --show-origin --show-scope system file:C:/Program Files/Git/etc/gitconfig http.sslbackend=openssl system file:C:/Program Files/Git/etc/gitconfig http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt system file:C:/Program Files/Git/etc/gitconfig