Created
October 29, 2020 10:21
-
-
Save m-tmatma/722f303dacc3d2c7120e4d3f05296274 to your computer and use it in GitHub Desktop.
git-util.sh
This file contains 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
#!/bin/sh | |
# https://qiita.com/m-tmatma/items/d9ceba9118d5f6c1be83 | |
if [ -e /etc/bash_completion.d/git-prompt ]; then | |
source /etc/bash_completion.d/git-prompt | |
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 " (%s)") \$ ' | |
fi | |
# https://qiita.com/m-tmatma/items/04456a9bd0e49bc43861 | |
alias co='git rev-parse --is-inside-git-dir > /dev/null 2>&1 \ | |
&& git checkout $(git branch -a | grep -v "/HEAD" | peco | sed -r "s#^\\s+remotes/origin/##" | sed -r "s#^\*\s+##")' | |
# https://qiita.com/m-tmatma/items/0e35e6b4b52656cf5776 | |
alias gg='git rev-list --all | xargs git grep' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment