Tag: bash

using awk sed to parse update puppet file

I have a puppet file with a number of lines of code that has a section that looks like this: $defaultrepo=myrepo $defaultbranch=mybranch gitmod::pullstuff {‘othergitcode’: gitcommit => “b54123be540adrwer3b65872384e0101c5f94c926b81”, gitorg => “${defaultrepo}”, branch => “${defaultbranch}”, } gitmod::pullstuff {‘mygitcode’: gitcommit => “b54123be540adrfer3b65872384e0101c5f94c926b81”, gitorg => ‘awesomerepo’, branch => “master”, } It can have any number of blocks that will […]

git diff during pre-commit hook results in Not a git repository

I’m trying to build a pre-commit script in git. In that script I plan on running tasks if a certain folder has changed. To test, in my script I have git diff –cached | grep -q “^my/folder” This results in… Not a git repository To compare two paths outside a working tree: usage: git diff […]

Creating a 'git log' alias with formatting

I have a bunch of git aliases already set up in my .bash_profile that work correctly: alias gst=”git status” alias gl=”git pull” alias gp=”git push” alias gd=”git diff | mate” alias gc=”git commit -v” alias gca=”git commit -v -a” alias gb=”git branch” alias gba=”git branch -a” I’m trying to add an alias for the following […]

How do I use Notepad++ Compare as the diff tool in git bash/command line?

Is there any way to change the default diff tool in gitbash? This post seems to suggest it is possible but they provided no command line examples. Link: Running NotePad++ from Command line with Compare Plugin showing compare result

Run git bash script in Windows 7/64bit

I am trying to run a git bash file in Windows 7, 64-bit. The file is below. The command is: git test-bash When the command is entered, there is a pause of no more than a second, then the prompt returns. There is no output to the terminal and no file created. What am I […]

Is there a way to add users automatically into gitlab?

I’ve got a gitlab running on server. For now, I’ve also got just a list of users and emails needed to be add into gitlab. Is there a way to do this automatically? (i.e. by script/service)

Is it possible to accept user input as part of a remote git post-receive hook?

I’ve got a post-receive hook that deploys our master branch whenever we push master. I’d like to make the deployment optional; the hook asks for simple Y/N response to achieve this; bash pseudo code below: echo “Should I deploy this code now? Enter Y/N” read deploy_code case ${deploy_code} in “Y”) do_a_deploy ;; “N”) exit ;; […]

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 Baby is a git and github fan, let's start git clone.