feat(profile): git aliases

This commit is contained in:
Price Hiller 2022-03-17 15:34:22 -05:00
parent 92f0e919e5
commit 20169abc82

View File

@ -96,10 +96,19 @@ if which git >/dev/null 2>&1; then
alias gr="git remote"
alias gl="git log"
alias gw="git worktree"
alias gwa="git worktree add"
alias gwr="git worktree remove"
alias git-remote="git config --get remote.origin.url"
alias gfo="git fetch origin 'refs/heads/*:refs/heads/*'"
alias gbc="git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'"
fi
gbf() {
local remote
local default_branch
remote="${1:=origin}"
default_branch="$(git remote show "${remote}" | awk '/HEAD branch/ {print $NF}')"
git fetch "${remote}" "${default_branch}":"${default_branch}"
}
## Mac Specific Aliases ##
if [[ "${OSTYPE}" = "darwin"* ]]; then
alias c="pbcopy"