Pipes in a Git alias?

I don't think you can, but you can prefix it with an ! to treat the command as a new shell command

[alias]
    pushcur = ! git branch | grep '*' …

I typically make small git- scripts and put them in a directory that's in my path (~/.local/bin). Check out git-extras for a bunch of good examples.


A simple workaround is to add it as shell alias.

Here is an example:

alias grf="git rebase -i $(git merge-base --fork-point master)"

(rebase on the fork commit of current branch and master interactively)

For bash, add it to ~/.bashrc, then you can simply use grf.