Skip to content

Instantly share code, notes, and snippets.

@hyrious
Last active June 30, 2023 05:08
Show Gist options
  • Save hyrious/72366c8d5a30a4548a3408dc01bbce2a to your computer and use it in GitHub Desktop.
Save hyrious/72366c8d5a30a4548a3408dc01bbce2a to your computer and use it in GitHub Desktop.
nushell git aliases i often use
# https://github.com/ohmyzsh/ohmyzsh/blob/-/plugins/git/git.plugin.zsh
def git_current_branch [] {
git symbolic-ref --quiet HEAD | str replace 'refs/heads/' '' | str trim
}
alias gl = git pull
alias gfa = git fetch --all --prune
alias gsw = git switch
alias gswc = git switch --create
alias grhh = git reset --hard
alias gpsup = git push --set-upstream origin (git_current_branch)
# Proxy
def-env proxy [
--undo(-u): bool # Unset proxy variables
] {
if $undo {
hide-env http_proxy
hide-env https_proxy
} else {
let-env http_proxy = http://127.0.0.1:10809
let-env https_proxy = http://127.0.0.1:10809
}
}
alias unproxy = proxy --undo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment