Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
25 views

Dealing with whitespaces in file names after git grep -l

I'm trying to run the script below and I'm struggling with pathspec error when the filename has whitespaces. I have already read some other posts around here, but since I am not an expert I was not ...
O Pardal's user avatar
  • 103
1 vote
1 answer
42 views

git - using gitconfig to switch repository host address

So right now I have some alias in my ~/.ssh/config: Host github_company_a HostName github.com Host github_company_b HostName github.com and I use the alias directly: git clone git@...
Prometheus's user avatar
0 votes
1 answer
69 views

I'm getting on gitbash a warning WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! for github

When I try to clone a git repository in gitbash on Windows I get following error: $ ssh -T [email protected] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST ...
Asterios Raptis's user avatar
0 votes
1 answer
86 views

Changed color settings of ble.sh bash terminal are not applied

I installed the ble.sh from this git repository https://github.com/akinomyoga/ble.sh.git, but i want to customize the color settings with ble-face commands. What happens is that, I changed the color ...
Vitor Martins's user avatar
1 vote
1 answer
105 views

git is unable to properly determine the terminal width (git-bash, windows)

As you can see in the screenshot, the terminal is currently 100 characters wide, and both methods of detecting such that I'm aware of are returning the correct value. Despite this, unless I explicitly ...
davidmwhynot's user avatar
0 votes
1 answer
108 views

Overwrite bash alias for git pull to include --recurse-submodules

Neither functions seem to affect anything for me? Is anyone able to get them working and show me what I'm doing wrong? I'm trying to override git pull to include recursive submodules whilst keeping ...
P1000's user avatar
  • 1
2 votes
1 answer
1k views

Windows Bash Terminal takes over 10 seconds to load

When starting up Git Bash in a Windows terminal or VScode terminal, the screen is blank for 10 - 15 seconds before it initializes to having a working directory and cursor. After init, it runs fine. ...
skwidflowz's user avatar
0 votes
1 answer
6k views

How to get out of git in the bash terminal's command line

My terminal's logline (is that the right term?) says I'm in git. How do I exit git?:
Al C's user avatar
  • 217
1 vote
1 answer
168 views

Force push current branch to origin if not master

I have a git alias for force pushing current branch: [alias] fp = "!git push -f origin \"$(git rev-parse --abbrev-ref HEAD)\"" Which basically maps fp to a command that does a ...
James Wierzba's user avatar
0 votes
0 answers
40 views

How to pass Ctrl+R to the git bash terminal in Visual Studio Code? [duplicate]

Right now while in git bash terminal inside VS Code if I press Ctrl+R nothing happened - VS Code awaits for the second key of chord: Is it possible to instruct VS Code to pass the Ctrl+R key ...
mark's user avatar
  • 866
0 votes
1 answer
294 views

Tortoise Git not using id_rsa

I use Tortoise Git on Windows 10. When I push it asks me password although I do have %userprofile%\.ssh\id_rsa file. I also tried to use git from command line (Git bash). If I google I get instructed ...
user1787194's user avatar
0 votes
2 answers
4k views

Setting environment variables in bash script doesn't work?

If I run this on the command line, it will make the commit be at the specified date: THE_TIME='2022-01-01T22:50:12 -0700' GIT_AUTHOR_DATE=$THE_TIME GIT_COMMITTER_DATE=$THE_TIME git commit -am 'commit' ...
Attribute's user avatar
0 votes
2 answers
411 views

Git Log of a particular file from a particular commit only

git log --graph --decorate --pretty=oneline --abbrev-commit --patch --full-history --follow -- "${FileP}" prints * b8800d8 (HEAD -> master, origin/master, origin/HEAD) chore(export): ...
Porcupine's user avatar
  • 473
0 votes
1 answer
1k views

Starting ssh-agent from a script for use in multiple scripts (invoked by git)

I have some homepages in a git repository each. They are built by Jekyll. When I change something, I use git's pre-push hook to let Jekyll build the page and sync it with my HTTP server via rsync. ...
Tobias Leupold's user avatar
0 votes
1 answer
795 views

Why is my git bash (mingw64) running a nonsense command when using the -c option?

I am getting this at the moment when using git bash: C:\>bash -c pwd C:\Program Files\Git\bin\bash.exe: line 1: $'MZ\220\003': command not found /c When I use the debbuging option, I get this: C:\&...
Haroon's user avatar
  • 11
0 votes
3 answers
169 views

Do command line applications generally close between user commands?

I recently stumbled upon applications that apparently are run purely through the command line. One of such applications is Git. When I run it in cmd.exe, bash or powershell I usually first specify the ...
Aiko's user avatar
  • 409
0 votes
1 answer
102 views

Git Push Successful, No Actual Files in Targeted Directories

I have a test and prod server, both running Ubuntu 20.04 with virtuamin 7 control panel, LAMP and git. Problem: My current git push configs seem correct. I get no errors at all... but at last, the ...
mjones's user avatar
  • 317
1 vote
2 answers
217 views

cut: the delimiter must be a single character

I am trying to get the branch name of all my branches on my repo but I am getting this error cut: the delimiter must be a single character Here is my script file git branch -a | grep -v HEAD | cut -d ...
etranz's user avatar
  • 119
0 votes
1 answer
338 views

terminal git status helper listed in .bashrc and .bash_profile not loading unless you source .bash_profile

I have the following neat helper, that I found online, that displays my current git branch at all times if I am in a git repo: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -...
codyc4321's user avatar
  • 410
0 votes
0 answers
92 views

bash function to quickly push git commits not working

I have the following function in my bash_profile that used to work for years and no longer works: cmpushall() { git add -A; git commit "$1"; git push ;} I now get the following error: $ ...
codyc4321's user avatar
  • 410
4 votes
2 answers
447 views

Git mergetool vimdiff diff3 view changed showing only “LOCAL” files

When solving a merge conflict using Git and Vim as mergetool, I (suddenly) get a totally different view than I expected and am used to. In the past, I followed this blog post, where the result is a ...
claudio's user avatar
  • 41
4 votes
3 answers
1k views

How to write wrapper function for git commands

I want to create a special alias for git log such that when I use that, it uses --graph and --pretty flags with a custom pretty format. I know I can use the git alias but, I don't want to cuz I want ...
Darkstar Dream's user avatar
1 vote
1 answer
407 views

Git Bash : neither .bash_aliases nor .gitconfig read automatically

I'm setting up a new computer, and, among other things, Git with Git Bash. I copied my .bash_aliases and .gitconfig from a previous computer, but I can't get Git Bash to source them automatically. ...
Charles's user avatar
  • 267
1 vote
0 answers
306 views

MSYS2 man: can't open the manpath configuration file /etc/man_db.conf

I'm on Windows 10 but using bash and MSYS2 (mingw64). I just installed man using MSYS2. The problem is when typing a command like man echo (can be any command; it doesn't have to be echo), I get this ...
Verpous's user avatar
  • 131
0 votes
0 answers
4k views

Could not resolve host: on WSL ubuntu after trying to install anything

I am trying to set up nvim but this is a general problem with anything I attempt to install. As an example root@DESKTOP-NAME:~# git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ~/.loc&...
Hydrolox's user avatar
0 votes
0 answers
204 views

git produces no output when called from script via cron (log/shortlog)

I've got a script git-test going to a local git repo and calling git shortlog to keep track of recent changes. For testing purposes, I just used these lines: #!/bin/bash cd /myrepo.git result="$(/...
Netnoob's user avatar
0 votes
0 answers
192 views

Reverse SSH on Windows Git BASH

I have multiples Windows 10 computer where I can't open anymore ports, neither install more software. But those computers have git bash installed on it. I would like to be able to run some bash script ...
olive007's user avatar
  • 121
0 votes
0 answers
1k views

How to fix permission denied publickey on Windows10 Git Bash?

I'm unable to ssh into a machine that operates bots of my friend. He added my public ssh key, so i can join, but I get the permission denied privatkey error message. I removed the actual ip $ ssh -vT ...
Timm's user avatar
  • 1
1 vote
0 answers
883 views

process exited with code 1 (0x00000001) after Git update 2.36.1 on Windows 10

After I tried to update my Git version to 2.36.1, on my Windows 10 machine I've been getting this error in the Windows terminal: [process exited with code 1 (0x00000001)] I have tried to check for ...
Krullmizter's user avatar
3 votes
1 answer
3k views

Capture Git output in a Bash variable

I want to capture a command execution output like below: $ o=$( git clone [email protected]:my-repo/demo.git ) Cloning into 'demo'... remote: Counting objects: 176, done. remote: Compressing objects: 100% ...
j4x's user avatar
  • 237
0 votes
2 answers
102 views

is it feasible to mute the extra connection info for git-bash on windows?

Assume I have a working http-server running on example.com:8080 On ubuntu, this command $curl http://example.com:8080/ gives <h1>hello</h1> while git-bash on windows gives extra ...
JJJohn's user avatar
  • 465
1 vote
1 answer
144 views

Git fetch prune failed remotes

My employer has a script that sets up git repositories, but in doing so it adds a lot of remotes that no longer exist. I would like to write a one-liner to prune these remotes. It seems that the ...
66h3m3ab's user avatar
0 votes
1 answer
476 views

Output from command missing when redirecting

I'm trying to capture output and seeing strange behavior. Some output will only show if no redirection is used. Can be replicated reliably with this docker example: FROM alpine RUN apk add git RUN \ ...
srfrnk's user avatar
  • 101
0 votes
1 answer
274 views

search over all drives in git bash crashes - "failed to read file names from file system at or below '/': No such file or directory"

I am using the git-bash for windows (what is internal msys2). I needed to search over all of my harddrives. When I try to run find / -type d (and my search patterns), the search runs over the system ...
Radon8472's user avatar
  • 801
1 vote
2 answers
8k views

Open git bash in current directory

Previously when I was in a directory, I clicked 'git bash here' and it would open in that directory. Now it opens my home directory. How can I fix this?
Joeri's user avatar
  • 11
0 votes
1 answer
118 views

Got daemonp error while installing doom

I am on Macos 10.14 and am trying to install Doom with Emacs. I've downloaded emacs with brew install --cask emacs, and it is at version GNU Emacs 27.2. I run the installation lines per doom's ...
Ross Jacobs's user avatar
1 vote
1 answer
3k views

Recovering deleted files deleted with Git Bash on Windows using rm -rf

While working in Git Bash on my Windows laptop, I accidently deleted important files and folders using rm -rf on C:>. Is there a way to restore them? Since the OS is Windows while tool is bash, ...
Prasad's user avatar
  • 11
1 vote
0 answers
193 views

What is the meaning of the plus (+) sign in the User section of my Git bash shell prompt?

I recently installed Bash for Windows to use Git on my office laptop with Windows 10, an OS I'm not so familiar with. When I open this bash terminal I expect the prompt would show you your username ...
Ge Se's user avatar
  • 11
0 votes
1 answer
202 views

Pass git stuck options with quotes as-is to a script

I'm trying to write a script that will be called as a git alias. The script is a wrapper around git merge, so I want to pass all it's parameters to git merge as-is when I call it in the script. The ...
CidTori's user avatar
  • 133
4 votes
2 answers
1k views

Git subtree installation broken on a Windows 2010 Pro install

Something I'm unable to track down the source of my broken my Git “subtree” command. I'm running Windows 2010 Pro. Here the error message, instead of display the help info: $ git subtree It looks like ...
gsscoder's user avatar
  • 143
2 votes
1 answer
284 views

Git shows modified *.ipynb files, cannot reset, stash or switch branch

I've been having this reoccurring issue recently: $ git status On branch foo Your branch is up to date with 'origin/foo'. Changes not staged for commit: (use "git add <file>..." to ...
oarfish's user avatar
  • 806
7 votes
1 answer
7k views

What is the correct Homebrew Installation command for an M1 Mac mini and Big Sur?

After reinstalling the whole M1 Mac mini, Big Sur and Migration Assistant for this morning's Time Machine's backup, I'm getting a new error when installing Homebrew: /bin/bash: line 156: /usr/local/...
James Walker's user avatar
0 votes
1 answer
166 views

Add custom path on specific key press after git command in Git bash

I am looking to reduce the repetitive work. Following is the example, currently, I am using frequently the following command and I want to custom set the directory. I.e git add /pkg/XYZ/123/456/789/...
hardika's user avatar
  • 101
5 votes
3 answers
8k views

How to customize shortcut keys on Git Bash Terminal (Windows 10)

How can I customize shortcut keys on Git Bash Terminal? When I use the Option -> Keys, it only allows to turn on or off the features. What I want is to change the key combinations. Here are my ...
LiemLT's user avatar
  • 61
0 votes
2 answers
1k views

GitHub SSH test comes back successfully but wrong username

I set up a SSH keypair as per the GitHub docs. When I test the SSH connection with Git Bash command ssh -T [email protected] it works but the message is: Hi saito0211! You've successfully authenticated, ...
treadnought's user avatar
1 vote
2 answers
3k views

(git) Bash: how exactly does a line break differ from \n in a variable?

My apologies, I must have made some mistakes when performing the initial tests, as after putting everything into a single script the xxd output does indeed always match the stdouput. The entire script ...
matthias_buehlmann's user avatar
0 votes
1 answer
964 views

Accessing Windows "current directory" per drive using Linux path syntax

I’m on a Windows system, using the cmd shell and running the excellent Linux-style command-line tools such as grep and diff that come with Git for Windows. These tools expect file and directory ...
Doug Ewell's user avatar
0 votes
1 answer
27 views

Does git/bash have any built-in way to commit all the commands and outputs you got into a file and have that automatically committed?

Currently I'm going through some CLI. I want to have a file that includes the commands that I ran before the commit. command: commit message 1 // All commands ran prior to this output: <output for ...
Honey's user avatar
  • 105
0 votes
1 answer
1k views

How to set Terminal tab title to show the current git branch (using zsh)?

ZSH allows for nice customized command line prompts that show the current git branch. I'd like to also show the current git branch in the title of the Terminal window or tab (the text in the bar at ...
lucas's user avatar
  • 157
1 vote
1 answer
195 views

How to pass argument to command substitution?

I want to change git branches by it's number To show branches numbers I use this (with alias): $ git br | nl 1 * master 2 test Now I want to get branch name by it's number and pass it ...
Alex Kosh's user avatar
  • 121

1
2 3 4 5 6