Tag: bash

Git Bash is displaying strange characters on Windows 7

I installed Gitbash in my Windows and defined the Linux command lines (ls to list directory for example) but the command line is returning strange characters. Reginaldo@Dell MINGW64 /c/dev/php/laravel/flamboyant (master) $ php artisan ←[32mLaravel Framework←[39m version ←[33m5.1.29 (LTS)←[39m ←[33mUsage:←[39m command [options] [arguments] ←[33mOptions:←[39m ←[32m-h, –help←[39m Display this help message ←[32m-q, –quiet←[39m Do not output any […]

Git: unable to redirect/parse the output of 'git fetch –dry-run' command

What is special about the output message of git fetch command that is printed on the console? I’m not able to use grep, xargs, etc. Not able to redirect the output to a file also.. Note: I’m using git fetch –dry-run command [sangeeth@localhost santest-code]$ [sangeeth@localhost santest-code]$ git fetch –dry-run > /tmp/1 From ssh://git.code.sf.net/p/santest/code 9f068d0..2b9dc4e master […]

Bash: Git submodule foreach?

I have sup aliased to submodule foreach ‘git co master; git up’ (co & up are aliases for checkout & pull –rebase, respectively.). How do add a condition so that if the submodule name is Libraries/JSONKit, it checks out the branch named experimental, instead of master?

Git completion and PS1 not working: “__git_ps1: command not found” on “sudo -s” or “sudo su” on Ubuntu 12.04

I installed git and git-flow completion adding these line to .bashrc of root and a normal_user on a Ubuntu 12.04 machine: source /etc/git-completion.bash source /etc/git-flow-completion.bash GIT_PS1_SHOWUPSTREAM=”verbose” GIT_PS1_SHOWDIRTYSTATE=true PS1=’\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ ‘ When I log as root or normal_user git completion works. However if I use “sudo -s” or “sudo su” git completion is not working and I […]

Git Bash bash: open: command not found

I’m new to Git Bash, just freshly downloaded this for use in my class today, on the first class module it ask me to cd in to different directory and ls the content which works perfectly fine in Git Bash, then it ask me to open a README.md file in a folder with the command: […]

Failed to connect to repository : Error performing command: git.exe ls-remote -h https://github.com/szabbas/Sample-programs.git HEAD

I am new to programming and trying to work with GIT repository and while configuring with the JENKINS is facing the error. I know it’s a silly question but on a beginner point of view I am stuck and can’t move forward. Please help me in resolving the error. I have my code at the […]

How to run ./script.sh in windows Git shell?

Maybe it’s awkward, but I can’t run .sh file on Windows when working in Git shell. Probably I have to install something, but I thought that Git will support that bash command (I know Windows don’t use sh files). I am doing installation steps from GameClosure and after $ ./install.sh a window with application selection […]

Export specific Git commits as patches

I am trying to export several commits (those that contain a specific ticket number 1234 in the commit message) to patch files. EDIT The working script is on https://github.com/amenk/SelfScripts/blob/master/git-extract-patches This is what I have #!/bin/bash -x commits=`git log –pretty=oneline | grep “#1234″ | cut -f1 -d” “` no=1; for COMMIT in $commits do git format-patch […]

Set SSH Identities In Bashrc

I have a .bashrc file to start my ssh agent (taken from here). Whenever I start my machine I keep having to add my identities to it (using ssh-add ~/.ssh my_private key). Not knowing bash scripting much, what (and where) do I adjust this script to add in my identities? SSH_ENV=”$HOME/.ssh/environment” # start the ssh-agent […]

aborting git pre-commit hook when var_dump present

I am trying (but failing miserably) to make a git pre-commit hook that checks for the presence of a var_dump in my modified files and exits if it finds one. The problem that I’m having is that it appears to always be aborting the commit. Here is the contents of my pre-commit file: VAR=$(git diff […]

Git Baby is a git and github fan, let's start git clone.