1
vote
2answers
33 views

Why asterisk in command result in for loop is expanding?

I want to write a script that will run git diff --name-status master..<BRANCH> but when I run this: for i in $(git branch | grep -v master); do echo $i; done I get echo one directory ...
5
votes
2answers
72 views

How can I pipe stdout to another program?

I'm trying to setup a linter for my code and I only want to lint the coffeescript files that have changed in the current branch. So, I generate the list of files using git: git diff --name-only ...
0
votes
1answer
37 views

Is there a way to make git commit have -v as a default?

I have git () { [ $1 = commit ] && command git commit -v "${@:2}" || command git "$@"; } It makes git commit have -v as a default, otherwise pass on the params and do whatever the git ...
2
votes
2answers
54 views

git diff - listen for key press

I want to run the following commands: git diff git commit git commit will open the default editor to edit the commit message. But if the difference if not too long it will close immediately. How ...
3
votes
1answer
787 views

Granting access to a restricted git shell

I tried setting up git-shell on our CentOS (6.4) system (after getting this working correctly on Ubuntu 13.10, maybe cross platform hot mess?) my /etc/passwd shows git:x:500:500:Web Archive ...
4
votes
1answer
784 views

SSH: “Permission denied” after changing user shell

I have an SSH server running on my Raspberry PI with ALARM (up to date). My user "gitroot" is meant to use the git-shell. However, when i set /usr/bin/git-shell as shell for gitroot in /etc/passwd, i ...
4
votes
2answers
149 views

Is it possible to restrict certain commands from being run in a directory?

I have two directories: src and projects. I would like to prevent myself from running git ... unless I am specifically inside src or projects. Is this possible?
3
votes
2answers
221 views

create pseudo shell for a command

I feel like this should be straighforward to some degree... Basically, for some command, I want to be able to invoke another command that will scope all params to that command. so... git commit -am ...
3
votes
1answer
229 views

Bash script with quotes and spaces

I'm trying to get some nice output out of git: FORMAT='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' LOG_PARAMS="--color --pretty=format:$FORMAT --abbrev-commit ...
16
votes
4answers
4k views

How can I create an alias for a git [action] command (which includes spaces)?

Most of my my aliases are of this form: alias p='pwd' I want to alias git commit so that it does git commit -v But trying to create an alias with a space gives an error: $ alias 'git commit'='git ...
10
votes
2answers
847 views

Can git configuration be set across multiple repositories?

Git seems to support configuration values at three levels: Per-system global settings (stored in /etc/git-core) Per-user global settings (stored in ~/.gitconfig) Per-repository local settings ...
5
votes
4answers
143 views

Change command-line “environment” to programs command

In a console, is it possible to change into a commands "environment"? To explain, I take "git" as an example. While programming and using a git repository, I change to the repos path and then do many ...
12
votes
3answers
6k views

Answer yes in a bash script

I'm trying to do a git clone trough a bash script, but the first time that I run the script and the server is not known yet the script fails. I have something like this: yes | git clone ...
3
votes
1answer
415 views

Git - remove deleted files

I'm using this simple git alias rmdel = "!git rm $(git ls-files -d)" meant "remove deleted", i.e. to remove from the staging area all files deleted from the file system. It works fine except ...