0
votes
1answer
118 views

Parse lines of output from bash loop

I'm trying to parse the output of commands run in a bash loop. Here is an example: $ for i in `git log --format='%H'`; do echo $i ; git branch --contains $i; done | head -n 8 ...
2
votes
1answer
65 views

Using xargs with git

I am trying to practice using xargs. I tried the following, passing the SHA1 via xargs: $ git show SHA1 --name-only I also tried: $ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' ...
2
votes
2answers
21 views

Clone repos with a similar name

I would like to do something like: git clone https://github.com/meteor{A,B,C,D}test but bash does not convert the {} into an each. What am I doing wrong?
0
votes
1answer
41 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 ...
0
votes
1answer
2k views

No package * available. cannot install git through yum

I am trying to install git on my Red Hat Enterprise Linux 6.5 server and have hit a brick wall. I can't find the package dependencies for git using yum. [root@FOOBAR mydir]# yum install ...
0
votes
3answers
106 views

apply specific command for each git repository

I want compress all the git repositories on my computer (say in ~). I.e., for each directory {}, that contains directory or file (in case of submodules) named .git, I want to execute git gc ...
1
vote
2answers
188 views

How to extend a command in bash so that it expands based on options?

I've started working with a git repository that includes a large amount of content that should be assumed readonly. So, every time I throw a new branch: git checkout -b newBranch it should be ...
2
votes
2answers
707 views

Use git submodule foreach with function

My indention is to have a script that updates all git submodules according to which branch is given. If there's no such branch for a submodule, master is used. This is what I have now: #!/bin/bash ...
3
votes
2answers
229 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 ...
6
votes
2answers
2k views

What does “--” mean in Linux/Unix command line? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? git diff [options] [<commit>] [--] [<path>…] In here, how should I understand what [--] means? And when should I use it.
5
votes
1answer
229 views

Custom bash autocomplete for git breaks other git autocomplete features

I am trying to add autocompletion to git commit upon hitting TabTab. The autocomplete feature I am working on is based on a branch-naming convention. The convention is to append the PivotalTracker ...
3
votes
1answer
235 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 ...
18
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 ...
4
votes
1answer
182 views

How does this git alias work?

Usually, git aliases are confined to a single command: git config --global alias.ci commit So, instead of git commit you could do git ci But it seems you can insert a function in there as well: ...
3
votes
2answers
183 views

place the aliased version of an existing command in /usr/bin/

I use Vim a lot, and I know how I can start vim in insert mode. So I have an alias named vii in my .bash_aliases file. On other hand I use Git a lot too, and I have this line in my .gitconfig: ...
5
votes
1answer
826 views

Git auto-complete

I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (git status, git checkout etc.) complete themselves when ...
36
votes
4answers
13k views

How to colorize output of git?

Is there a way to color output for git (or any command)? Consider: baller@Laptop:~/rails/spunky-monkey$ git status # On branch new-message-types # Changes not staged for commit: # (use "git add ...
3
votes
3answers
3k views

How can I pass output of one command as an argument to another

A similar question has been asked, but since I am new to Unix the answer was not clear to me due to the context. What I want to do is to pass the output of one command as an argument to another. I am ...
0
votes
2answers
752 views

Git Server Bash and SSH

I want to use Git over SSH with my Linode VPS running Ubuntu 10.04 LTS. Instructions seem pretty easy, infact given I had already setup my SSH key etc.. All I had to do was instruct my local ...
5
votes
3answers
776 views

extracting “tag” information from git with a shell script

The vc bundle is a neat little package that extracts information about a git repo for easy insertion into a LaTeX document. It doesn't currently extract information about whether the current commit is ...
3
votes
2answers
213 views

Specifying which git repo to use

I have a bash script, called cgit, that acts as git for one specific git repo (located at /.git): #!/bin/bash cd /; sudo git $@ > /dev/stdout I use it to keep track of imporant system files: ...