Tag: bash

How to use a parenthesis character inside a command substitution inside a bash snippet inside a git configuration alias?

Here is an excerpt from the config I am editing. This is inside the [alias] section of my .gitconfig: ignored = !git ls-files -v | grep “^S” status-with-ignored = “!f() { git status; ignored=$(git ignored | cut -d ‘ ‘ -f 2 | sed -e s/^/z/ -e s/$/z/); [ -n \”$ignored\” ] && echo \”git […]

Git commit hook – How to use the commit-msg hook to check for string in message?

I need to make a commit-msg hook to check if the commit message contains “app.asana” in any part of this. I searched some references and documentation and I know I need to use the commit-msg for this. I have to make this using Perl or Bash. Does anybody has a clue about this or somewhere […]

Git – Use port 9418 for remote on github

I am trying to connect to github at school but port 443 is blocked. The admin told me to use port 9418 instead which I believe is the default port for the git protocol. But in git bash (windows) if i try to do git remote set-url origin git://github.com/me/myrepo.git and do a push, it tells […]

setgid bit not preserved by git on new directory in `.git` folder?

I have a bare git repository setup for user fred: /home/fred/foo.git I have set the group of every file in foo.git to bar: $ chown -R fred:bar /home/fred/foo.git (Note that fred is not a member of group bar) And I have set the setgid bit on for every directory in foo.git: $ find foo.git -type […]

bundle install not running from my post-update hook

I’ve setup a post-update hook for my project. I have a bare repository (/var/git/myproject) which I push to, and a live repository (/var/www/myproject) where my app is running. I also included bundle install and bundle exec rake db:migrate to install gems and update db. Below is my post-update hook #!/bin/bash echo “Pulling changes into Live…” […]

git post-update script does not work

After editing my old question a few times, I make a new one because it is a new question now. In .git/hooks/post-update I have: echo “a” >> /home/pi/log git update-server-info git stash git merge testing >> /home/pi/log To make an automated checkout. So I run on the client: git push testing HEAD:testing Now my /home/pi/log […]

Where can I get the fmt binary for MSYS/MinGW?

I am using virtualenvwrapper with Git Bash (msysGit). Mostly this works fine, but the lsvirtualenv command relies on the fmt unix command, which is not currently on my path. I would like to add only fmt.exe to my Git Bash bin if possible, in the interests of doing a minimal install. For the life of […]

Git : Determine if branch is in a merge conflict state

I am writing a bash script to do some automation. Part of the script involves navigating to a local repo, switching to the local master branch, then pulling the remote master to update the local master branch with the latest code. Does anyone know if there’s a way I can programatically determine if the pull […]

broken bash prompt wrap line

I’m customizing my bash prompt on OsX to include git branch plus some marks of the branch state. This breaks line wrap. I know that I have to add \[ and \] to prevent this issue, but doing so in the functions does display \[ and \] litteraly. What can I do to escape such […]

Function in bash to commit and push in one command

I try to commit and push in one command, typing something like: gm “This is my commit message” Which would run: git commit -am “This is my commit message” && git push I’ve tried this function in my .bashrc: function gm() { git commit -am $1 && git push } Which works, except for the […]

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