Add labs and git clone alias

This commit is contained in:
2021-05-01 15:08:04 +01:00
parent 2d25e61e34
commit acc88fdf81

View File

@@ -44,9 +44,21 @@ alias \
ll="ls -l" \
la="ls -al" \
ag="alias | grep" \
lc="clone_from_labs" \
gc="clone_from_github" \
enp="enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show" \
dgit="git --git-dir ~/.config/dotfiles/.git --work-tree=$HOME"
# Clone from labs
function clone_from_labs() {
git clone "git@labs.scarif.space:chris/$1" "${@:2}"
}
# Clone from github
function clone_from_github() {
git clone "https://github.com/$1" "${@:2}"
}
# Check if main exists and use instead of master
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return