Tag: bash

How to get the name of the current git branch into a variable in a shell script?

This question already has an answer here: How to programmatically determine the current checked out Git branch 19 answers

Delete all local git branches

I follow a development process where I create a new local branch for every new feature or story card. When finished I merge the branch into master and then push. What tends to happen over time due to a combination of laziness or forgetfulness, is that I end up with a large list of local […]

Git sh.exe process forking issue on windows XP, slow?

Git is essential to my workflow. I run MSYS Git on Windows XP on my quad core machine with 3GB of RAM, and normally it is responsive and zippy. Suddenly an issue has cropped up whereby it takes >30 seconds to run any command from the Git Bash command prompt, including ls or cd. Interestingly, […]

setting tabwidth to 4 in git show / git diff

At work we are several developers and don’t have a code style guide, and some developers indent with tabs, and some others with 4 spaces (luckily noone of the indent with spaces people uses different than 4 spaces). In general this is no (big) problem because in our editors we set tabwidth=4 and all the […]

Use of an exclamation mark in a Git commit message via command line?

How do I enter an exclamation point into a Git commit message from the command line? It is possible to escape the exclamation point with a backslash, but then the backslash ends up in the commit message as well. I want something like this: git commit -am “Nailed it!”

Git server's host key not cached in registry – GitHub.com

Continuation of issue here: I’m trying to set up my first Git Repository on GitHub. (Note, this means I can’t use putty, I’m using openssh, or at least I’m supposed to and I think I am). I’ve been following the documentation on GitHub’s website here. I get everything right up until the very last command: […]

Git Status Across Multiple Repositories on a Mac

I have been searching for a solution to this for a while and have not found quite what I need. I have several Git Repositories in a folder on my Mac (OSX 10.6) and would like a script or tool that will loop through all the repositories and let me know if any of them […]

What is the difference between Git Bash and the GitHub for Windows shell?

I’m referring to the shell that comes with GitHub for Windows, and Git Bash (which has a stand alone installer).

Why doesn't my bash prompt update?

I’m new to git and I’m trying to add the current git branch to my already existing prompt, which is defined as follows : RESET=”\[\017\]” NORMAL=”\[\033[0m\]” RED=”\[\033[31;1m\]” YELLOW=”\[\033[33;1m\]” WHITE=”\[\033[37;1m\]” SMILEY=”${WHITE}:)${NORMAL}” FROWNY=”${RED}:(${NORMAL}” SELECT=”if [ \$? = 0 ]; then echo \”${SMILEY}\”; else echo \”${FROWNY}\”; fi” export PS1=”${RESET}${YELLOW}\u@\h${NORMAL} \`${SELECT}\` ${YELLOW}\w $(__git_ps1) >${NORMAL} ” I tried it (by […]

PS1 line with git current branch and colors

Here is my current PS1 export PS1='[\u@\h \W$(__git_ps1 ” (%s)”)]\$ ‘ How can I display the current branch in a different color?

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