Created
November 30, 2020 09:23
-
-
Save d4vidi/3743cba943f9bebed9f8f9cba1bb249d to your computer and use it in GitHub Desktop.
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
alias ll='exa -alF' | |
alias lt='exa --tree' | |
alias lt2='exa --tree --level=2' | |
alias lt3='exa --tree --level=3' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
# Git and Github | |
alias gits='git status' | |
alias gitss='git status -s' | |
alias gs='git status' | |
function gss() { | |
LINES="$@" | |
if [ -z "$1" ]; then | |
# script -q /dev/null git status -s | grep -n '' | |
script -q /dev/null git status -s | nl | |
else | |
GIT_STATUS=`git status -s` | |
files="" | |
for i in ${LINES}; do | |
file=$(echo "$GIT_STATUS" | awk '{print $2}' | head -"$i" | tail -1) | |
files+="$file " | |
done | |
echo $files | |
fi | |
} | |
function gitadd() { | |
git add `gss $@` | |
} | |
alias gp='git pull' | |
alias gpr='git pull -r' | |
alias thisbranch='git rev-parse --abbrev-ref HEAD' | |
function gitupstream() { | |
echo "Setting upstream for: `git rev-parse --abbrev-ref HEAD`" | |
git push --set-upstream origin `git rev-parse --abbrev-ref HEAD` | |
} | |
function cpbranch() { | |
BRANCH=`thisbranch` | |
echo "$BRANCH" | pbcopy | |
echo "$BRANCH copied to clipboard" | |
} | |
alias giturl="git config --get remote.origin.url | sed 's com: com/ g' | sed 's git@ https:// g' | sed 's \.git g'" | |
alias github="giturl | xargs open" | |
function githubcommit() { | |
open `giturl`/commit/$@ | |
} | |
function githubbranch() { | |
open `giturl`/tree/`thisbranch` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment