3,503 questions
-3
votes
0
answers
22
views
Set environmental variable with the results from sed [duplicate]
I am using Git Bash and launching ssh-pageant to talk to Windows Pageant. Window pageant holds my ssh keys. I have configured Windows ssh to use pageant following the instructions given in the PuTTY ...
3
votes
1
answer
71
views
Using tr to replace by "\ " but only gets "\" symbol as an output
When typing the command :
echo 'Hello;World' | tr ';' '\\ '
Output : 'Hello\World'
Expected Output : 'Hello\ World'
Is there a valid way to obtain the expected output ?
Note that when using echo '...
0
votes
0
answers
97
views
Git for Windows : bash.exe not found
I try to start Git Bash (Git for Windows) on a DOS shell but get the error message:
>C:\APPS\Git\bin\bash.exe
Skipping command-line '"C:\APPS\Git\bin\..\usr\bin\bash.exe"'
('C:\APPS\Git\...
0
votes
0
answers
78
views
git-bash gettext wrong encoding
I'm trying to translate my bash scripts using the gettext tools but I have a problem where the encoding seems to be wrong.
Let's say I have the following file called fr.po:
# French translations for ...
2
votes
1
answer
74
views
In Windows Git Sparse Checkout does not work as expected and downloads unwanted files
I have a folder structure in a Git Repo like the following:
.
└── top_level/
├── invalid_file_names/
│ ├── <?>.txt
│ └── <<>>?.txt
└── valid_files/
├── ...
0
votes
0
answers
55
views
Getting an 'Not a tty' error when running python .exe that generates a QR Code in Git Bash
Failing in GitBash when trying to use python to generate a QR Code. Fails on the print line. Works find on windows device.
Error Message:
Traceback (most recent call last):
File "awsauth.py&...
1
vote
0
answers
77
views
redirect STDERR in git-bash for Windows (11) not working any more
I have been using a bash script on my Windows environment for a long time to automate certain git commands. With a new Windows 11 installation I get a completely unexpected problem with the script: ...
1
vote
1
answer
88
views
How do I provide the correct file paths to merge-doc.js in Git config using Git bash in Windows?
I'm trying to use the merge-doc.js script in my Git config for merge driver and mergetool for .docx, but the TortoiseGit helper script that starts a compare in Word using DCOM requires absolute paths ...
2
votes
2
answers
201
views
Function doesn’t update global array
I wrote a simple quick sort algorithm. When I run it, it echoes the same array back.
#!/usr/bin/bash
arr=(1 8 3 9 4 5 7 2)
partition() {
local low=$1
local high=$2
local pivot=${arr[low]}...
-1
votes
2
answers
152
views
Unable to create a new repository remotely [duplicate]
I am creating several new repositories and I want to automate it for a future product I am building. Got stuck on the first step. The following command works (at least there is no error message):
git ...
-6
votes
1
answer
105
views
How to create new orphan git branch and keep only one folder? [closed]
I tried this
git checkout --orphan newfeature/lk1
Inside I have
A,B,C....
my goal was delete all except the one,A
find . -name A -prune -o -print0 | xargs -0 rm
It did not work for me.
I am using ...
-3
votes
2
answers
166
views
Git switch to branch silently only partially updates working directory when extraneous directories are present
Git is behaving very strangely by silently failing to update the working directory contents when changing to a branch relative to a remote under certain conditions, e.g. if there is an empty directory ...
0
votes
0
answers
127
views
VS Code Python extension injects incorrect start up script oh-my-posh variables with shell integration
The task
I'm using oh-my-posh to display extra info in the terminal for PowerShell (v7) and Git Bash.
The problem
When using Windows Terminal I can see that the theme changes are present, but in the ...
2
votes
1
answer
198
views
Emojis won't show up properly in build logs for Maven Project name on Git Bash
I have a pom file whose name looks similar to this.
<name>Some Name 😊</name>
But when I performed the maven build, I got this instead.
Some Name 🙂
I set my project encoding to utf-8, ...
4
votes
0
answers
99
views
git clone failing only in very specific circumstances [duplicate]
My system is Windows 11. I am using latest git bash from 2025-06-28.
I am trying to clone the public github repository https://github.com/eringee/biodata (over HTTPS) / [email protected]:eringee/biodata (...
0
votes
1
answer
372
views
AugmentCode + VS Code runs PowerShell instead of Git Bash for automation tasks despite configuration
I've configured VS Code to use Git Bash as my default terminal, but when AugmentCode runs commands (like Flutter commands or tasks), it still uses PowerShell.
What I've already done:
Set Git Bash as ...
1
vote
0
answers
103
views
How do I fix a bad config error when launching jupyter from GitBash?
I'm new to this and I'm trying to learn Python. I've got Git Bash installed and Anaconda 3 and whenever I got to launch jupyter from Git Bash I get a bad config error. This is the commands I'm using ...
1
vote
0
answers
160
views
Supabase CLI: Cannot type password (IME issue) in Windows Git Bash (Zsh/PowerShell)
I'm a complete beginner developer working on Windows 10/11, using Git Bash (with Zsh shell) as my terminal. I'm encountering a critical issue when trying to log in or link my project using Supabase ...
1
vote
1
answer
95
views
How do I type a TAB character in jshell?
In jshell, typing the TAB key on my keyboard serves as both auto-completion, as well as lets you see a short view of the documentation.
How do I type a literal TAB character in jshell?
Sometimes, when ...
0
votes
0
answers
73
views
How to use git bash as the SHELL in a windows Dockerfile where bash is already installed
Here is my windows Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $...
2
votes
1
answer
147
views
How do I set a config value in Git which has a space in it?
In Git Bash in Windows 11 I try to set the user name via the command line. This fails as only the part before the first space is processed.
$ git config --global user.name "Your Name"
$ ...
0
votes
0
answers
84
views
Git Fetch - Permission Denied, Unable to Write File
I know this issue has been posted about multiple times, but none of the answers on any other question has helped.
git fetch --depth=601 remote: Enumerating objects: 35562, done.
remote: Counting ...
1
vote
4
answers
142
views
Printing arbitrary relative dates like git log --relative-date
I'm working on some dev tooling in/for Bash 5.2 (Git Bash for Windows) environments.
What I'm looking for
I'd like to be able to take an arbitrary UTC timestamp (e.g. @1746111769) and print a coarse, ...
0
votes
1
answer
456
views
git commit is very slow when precommit hook is activated
Here is my precommit hook (found on stack overflow) :
#!/bin/bash
# taken from : https://stackoverflow.com/questions/39576257/how-to-limit-file-size-on-commit
hard_limit=$(git config hooks....
0
votes
1
answer
93
views
Different Maestro CLI output on Windows vs WSL
I'm using Maestro on Windows, and I followed the official installation and setup guide from the official documentation page: official guide to install Maestro on Windows
I also installed Maestro on ...
1
vote
1
answer
118
views
How to set the Git Bash Vim's color file outside of "Program Files"
I'm using Windows, in Git Bash, if I use vimdiff as the compare tool, Git will trigger the vimdiff in its package.
However, it's hard to add a new color scheme, e.g. gruvbox.
Git's vim is in C:\...
0
votes
0
answers
108
views
Git Bash in VSCode Cannot Find conda in One Project – "No such file or directory" (cygdrive)
Issue Summary:
I'm on Windows using Git Bash in VSCode. When I open a Git Bash terminal in one specific project and try to run conda, I get the following error:
bash: /cygdrive/c/Users/tssom/anaconda3/...
1
vote
1
answer
311
views
Git Bash on Windows: *"Error connecting to agent: No such file or directory"* when using Windows OpenSSH Agent
I’m using Git Bash on Windows, and I'm trying to use the Windows OpenSSH agent to manage my SSH keys. Despite successfully starting the SSH agent as a service, I encounter the following error when ...
2
votes
0
answers
80
views
Git Bash: Change focus to external program
OS: Windows11
git version 2.23.0.windows.1
On git bash, when I type in a command that opens an external program (for example, gvim, gitk etc.), how do I change the focus to the newly opened program i....
0
votes
0
answers
41
views
Mounting Data file using docker
I am trying to mount data using a docker container. It doesn't ever seem to mount and I don't know what I am doing wrong. I am using the git bash terminal.
I am inside the folder called "...
0
votes
1
answer
167
views
Issues with setting discourse up on localhost
I’m trying to set up Discourse locally using Docker on Windows, but I’m running into errors. Here’s what I’ve done so far:
Installed Docker Desktop and ensured it’s running.
Cloned the Discourse ...
0
votes
1
answer
60
views
VS Code terminated the bash terminal with code 2 after startup using args --login -i --rcfile .bashrc
How can I run the bash terminal in VS Code using my .bashrc which is located in the project directory?
I wrote the arguments for launching the bash terminal in settings.json
VS Code settings.json
...
1
vote
2
answers
333
views
How to install gitpython in GitBash on Windows?
I downloaded Python 3.13.2 zip archive (Windows embeddable package (64-bit)). It contains the following files:
_asyncio.pyd
_bz2.pyd
_ctypes.pyd
_decimal.pyd
_elementtree.pyd
_hashlib.pyd
_lzma.pyd
...
2
votes
1
answer
212
views
GitHub PAT cannot modify workflow files
AIM: To modify one GitHub Actions .yaml file by running another GitHub Actions file. Specifically, I want to randomize the cron schedule of the other file.
PROBLEM: It gives error
! [remote rejected] ...
1
vote
0
answers
96
views
How to Extract Only Changed Files from a PR After Cloning a Git Repository?
I have a Git repository with multiple branches, and I need to clone it to my local machine. My goal is to extract only the files that were changed in each Pull Request (PR) and copy them to a separate ...
0
votes
0
answers
79
views
How to resolve a merge conflict using command line or github [duplicate]
I submitted a few files, all to separate branches and made a PR. But my PRs were closed with unmerged commits because I had to fix some issues with my code. I resubmitted after and made new PRs but ...
0
votes
0
answers
194
views
How to handle `bash: warning: command substitution: ignored null byte in input` in VS Code git bash terminal?
I am using git bash terminal in vscode for a git repository and the terminal unexpectedly shut off during a process. (I was installing packages from a requirements file and I am thinking my internet ...
0
votes
0
answers
49
views
gitbash creates a new empty .npmrc file everytime it opens
Everytime i open a new gitbash terminal, then a new empty .npmrc file is been created and it overwrites the existing config file (if one was existing).
I work on windows. I uninstalled git for windows ...
0
votes
0
answers
96
views
"fatal: unable to access" git config path "Invalid argument"
On a morning like any other, I run git status in Git Bash, only to be greeted with this:
fatal: unable to access 'C:\Users?artolomeo/.config/git/config': Invalid argument
For context, my Windows ...
0
votes
0
answers
31
views
Why a long line printed by python in gitbash or cygwin become broken (multiple) lines when being copy and pasted?
I have a python program that prints some examples so that users can copy and paste to run. The examples are all long lines.
I noticed that when python printed a long line in gitbash, and then I copy ...
3
votes
1
answer
729
views
VSCode integrated terminal displays the wrong path but opens in the correct directory in projects with a virtualenv
When I open a GitBash terminal in VSCode while I have a virtual environment activated, the path displayed on top of the input line is C:/Users/username/AppData/Local/Programs/Microsoft VS Code, but ...
0
votes
1
answer
337
views
VS Code Opens Wrong Virtual Environment After Restarting Terminal (Git Bash on Windows 11)
I’m new to VS Code and I’m trying to create a virtual environment for my project. I’m using Windows 11 and Git Bash as my terminal.
Steps I Followed
Navigate to the project directory:
My_Name MINGW64 ...
0
votes
1
answer
169
views
git bash on Windows: when press ESC key multiple times, then will be blocked
When using git bash on Windows, pressing ESC key for multiple times, then the input will be blocked. And after several seconds or more, it might show below information:
MyHome+tomxue@DESKTOP-I23OD70 ...
1
vote
0
answers
65
views
Why don't Ctrl+L or the clear command work in Git Bash after using mongosh, unlike in VS Code's Bash or PowerShell? How can I fix this?
When I use the mongosh command in Git Bash and try to clear the screen using Ctrl+L or the clear command, it doesn't work. However, both commands work fine in the VS Code terminal, whether in Bash or ...
0
votes
1
answer
95
views
How to access the output of a GitHub reusable action?
I'm attempting to make a reusable action that is capable of getting all the files of a certain type that were modified since the last push. The action works perfectly and its output is as follows (...
1
vote
1
answer
32
views
$REMOTE point to different branches in git merge vs. rebase?
I want to configure kdiff3 to use a specific order for windows (from left to right): $REMOTE | $BASE | $LOCAL. However, I encountered an issue where $REMOTE differs between merge and rebase commands.
...
0
votes
1
answer
47
views
How to find and remove code block accross multiple html files in subdirectories
Lets say I’m working on a project where I need to remove a specific block of SEO-related code from hundreds of index.html files located in various subdirectories within a root directory. Here's the ...
1
vote
0
answers
26
views
Msys 'bash -c' behaves differently from Git Bash than from cmd.exe
Trying to diagnose why an MSYS command fails within a buildsystem when it is invoked from Git Bash, even though the buildsystem succeeds when it is invoked from CMD.
I've noticed that, when I invoke ...
2
votes
3
answers
164
views
How to Customize Git Bash Prompt to Show Subdirectories After a Specific Folder (Similar to Codespace)
I’ve been using Git Bash on Windows, and recently, I had the chance to try Codespace. I loved how the Codespace terminal setup was very clean and simple.
When you open the terminal, there is no path ...
0
votes
1
answer
48
views
grep via child_process.spawn works on Git Bash for Windows, or real bash on Linux - but not both
The following code works on Windows but not on Linux (Amazon Linux 2023):
const regex = "((fa[lrsdb]\\s+|(fa-(?:solid|regular|light|thin|duotone|brands|sharp|sharp-duotone)\\s+)+)(fa-fw\\s+)*)(fa-...