Tag: bash

How do I maintain the version number of my bash script which is git source controlled?

I’ve just finished the first working version of a more complex bash script, and I’m wrapping my head around on how to maintain the scripts version. Why do I need this? Following GNU Coding Standards For Commandline Interfaces I’ve added a version option which among a license and copyright header shows the current version. Still, […]

How to make git diff ignore comments

I am trying to produce a list of the files that were changed in a specific commit. The problem is, that every file has the version number in a comment at the top of the file – and since this commit introduces a new version, that means that every file has changed. I don’t care […]

Succinct way to create a tracking branch with Git

Today I had to work with a remote branch called origin/}__test_syntax_error_in_simpack_settings. I wanted to create a tracking branch for it. I had to type: git branch }__test_syntax_error_in_simpack_settings origin/}__test_syntax_error_in_simpack_settings I didn’t have autocompletion on the first argument, only on the second. I don’t like typing. Is there a faster way to do this? The main barrier […]

How do I get my iTerm prompt to display differently when I'm in a Git branch?

I’m trying to get my iTerm prompt set up the same way as Paul Irish So far I have the following in ~/.profile: # Add git branch name to prompt parse_git_branch() { git branch 2> /dev/null | sed -e ‘/^[^*]/d’ -e ‘s/*\(.*\)/ on \1/’ } PS1=’\n\[\033[0:35m\]\u\[\033[0;32m\]\w\[033[0m\]$(parse_git_branch)\n\$\[\033[0m\] ‘ I don’t know how to make just the […]

ignore bash backtick execution without escaping the ` character in git commit

I use backtick character in my commits very often. I also usually commit using git commit -m When I run a command like this git commit -m “add `foo`” Bash tries to execute foo. I can use backslash \ to escape the backtick but I am wishing for a better solution to avoid escaping backtick […]

env: bash\r: No such file or directory

I’m trying to install YouCompleteMe from here. When I execute: ./install.sh –clang-completer I get this error: env: bash\r: No such file or directory I don’t know whats wrong with environment variables. Here’s my bash path: which bash /bin/bash Do I need to change it to /usr/bash? If yes, then how should I do that? I […]

Shell script to check if specified Git branch exists?

This question already has an answer here: Is there a better way to find out if a local git branch exists? 11 answers

Git 2.5.1's bash console doesn't open python interpreter

If I do it in CMD, it works without issues, but if I try it in Git Bash it doesn’t work. I like to use Git Bash as my only console, but I can’t do that if it doesn’t work with Python 3.4. Example is in the picture below. This can be easily reproduced. Uninstall […]

Cygwin: color coding and branch info for git?

Seem to be having a problem because I just recently changed my client for the gitbash to cygwin but i am missing color coding when i do git status for example and also the bash prompt doesn’t include the current branch / rebase etc Does anyone know how to make cygwin look like gitbash? You […]

Cygwin gitk issue

I have recently installed all of the X11 packages in the cygwin setup and now have is massive annoying error with not being able to see gitk. Everything was working perfectly well until I installed this stuff. Before I had this issue I didn’t really note done any of the configuration I merely started xwinserver […]

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