A collection of my "dotfiles" on Windows. I use this in combination with Cmder with a git bash shell.
Last active
June 22, 2017 11:35
-
-
Save svenluijten/f3b2d52223f66264587b39216679a404 to your computer and use it in GitHub Desktop.
Handy bash functions I commonly use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start the SSH agent and add all ed25519 and rsa keys. | |
function agent() { | |
eval `ssh-agent -s` | |
if [ -f ~/.ssh/*_ed25519 ]; then | |
ssh-add ~/.ssh/*_ed25519 | |
fi | |
if [ -f ~/.ssh/*_rsa ]; then | |
ssh-add ~/.ssh/*_rsa | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filesystem traversal | |
alias e.="explorer.exe ." | |
alias ll="ls -lah" | |
alias ..="cd .." | |
alias home="cd ~" | |
# PHP development | |
alias a="php artisan $*" | |
alias cdu="composer dump autoload" | |
alias test="./vendor/bin/phpunit $*" | |
alias tef="./vendor/bin/phpunit --filter $*" | |
# General utility | |
alias s.="subl ." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reload the dotfiles. | |
function fresh() { | |
( source ~/.bashrc && source ~/.profile ) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = John Doe | |
email = [email protected] | |
[alias] | |
st = status -sb | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
df = diff -- | |
ap = add -p | |
ges = !git stash && git pull origin HEAD && git stash pop | |
find = log --pretty=\"format:%Cblue%H %Cgreen%s%Creset\" --abbrev-commit --grep | |
[branch] | |
autosetuprebase = always | |
[core] | |
autocrlf = true | |
excludesfile = '~/.gitignore' | |
[push] | |
default = current | |
[color] | |
ui = true | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Execute Homestead-related vagrant commands globally | |
function homestead() { | |
( cd ~/Homestead && vagrant $* ) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove stale git branches (branches that are not present on the remote) | |
function unstale() { | |
git fetch --prune | |
for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do | |
git branch -D $branch; | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment