mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-10 09:29:50 +00:00
Compare commits
4 Commits
b5c449e1eb
...
945d89f7ae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
945d89f7ae | ||
|
|
8a231b1930 | ||
|
|
475b18f39a | ||
|
|
d4a62a2715 |
@@ -234,40 +234,29 @@ branch exists. We do this via the function `git_main_branch`.
|
|||||||
These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not,
|
These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not,
|
||||||
receive further support.
|
receive further support.
|
||||||
|
|
||||||
| Alias | Command | Modification |
|
| Alias | Command | Modification |
|
||||||
| :------- | :-------------------------------------------------------- | :-------------------------------------------------------- |
|
| :------- | :-------------------------------------------------------- | :-----------------------------------------------------|
|
||||||
| `gap` | `git add --patch` | New alias: `gapa`. |
|
| `gap` | `git add --patch` | New alias: `gapa` |
|
||||||
| `gcl` | `git config --list` | New alias: `gcf`. |
|
| `gcl` | `git config --list` | New alias: `gcf` |
|
||||||
| `gdc` | `git diff --cached` | New alias: `gdca`. |
|
| `gdt` | `git difftool` | No replacement |
|
||||||
| `gdt` | `git difftool` | No replacement. |
|
| `ggpull` | `git pull origin $(git_current_branch)` | New function: `ggl` (`ggpull` is now aliased to this) |
|
||||||
| `ggpull` | `git pull origin $(current_branch)` | New alias: `ggl`. (`ggpull` still exists for now though.) |
|
| `ggpur` | `git pull --rebase origin $(git_current_branch)` | New function: `ggu` (`ggpur` is now aliased to this) |
|
||||||
| `ggpur` | `git pull --rebase origin $(current_branch)` | New alias: `ggu`. (`ggpur` still exists for now though.) |
|
| `ggpush` | `git push origin $(git_current_branch)` | New function: `ggp` (`ggpush` is now aliased to this) |
|
||||||
| `ggpush` | `git push origin $(current_branch)` | New alias: `ggp`. (`ggpush` still exists for now though.) |
|
|
||||||
| `gk` | `gitk --all --branches` | Now aliased to `gitk --all --branches`. |
|
|
||||||
| `glg` | `git log --stat --max-count=10` | Now aliased to `git log --stat --color`. |
|
|
||||||
| `glgg` | `git log --graph --max-count=10` | Now aliased to `git log --graph --color`. |
|
|
||||||
| `gwc` | `git whatchanged -p --abbrev-commit --pretty = medium` | New alias: `gwch`. |
|
|
||||||
| `gup` | `git pull --rebase` | now alias `gpr` |
|
|
||||||
| `gupv` | `git pull --rebase -v` | now alias `gprv` |
|
|
||||||
| `gupa` | `git pull --rebase --autostash` | now alias `gpra` |
|
|
||||||
| `gupav` | `git pull --rebase --autostash -v` | now alias `gprav` |
|
|
||||||
| `gupom` | `git pull --rebase origin $(git_main_branch)` | now alias `gprom` |
|
|
||||||
| `gupomi` | `git pull --rebase=interactive origin $(git_main_branch)` | now alias `gpromi` |
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
### Current
|
### Current
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
| :----------------------- | :-------------------------------------------------------------------------------------------------------------- |
|
| :----------------------- | :------------------------------------------------------------------------------------------------------------- |
|
||||||
| `current_branch` | Returns the name of the current branch. |
|
| `git_current_branch` | Returns the name of the current branch (Lives in `lib/git.zsh`) |
|
||||||
| `git_current_user_email` | Returns the `user.email` config value. (Lives in `lib/git.zsh`.) |
|
| `git_current_user_email` | Returns the `user.email` config value (Lives in `lib/git.zsh`) |
|
||||||
| `git_current_user_name` | Returns the `user.name` config value. (Lives in `lib/git.zsh`.) |
|
| `git_current_user_name` | Returns the `user.name` config value (Lives in `lib/git.zsh`) |
|
||||||
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. |
|
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise |
|
||||||
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |
|
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise |
|
||||||
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
|
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote |
|
||||||
| `gbda` | Deletes all merged branches |
|
| `gbda` | Deletes all merged branches |
|
||||||
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
||||||
|
|
||||||
### Work in Progress (WIP)
|
### Work in Progress (WIP)
|
||||||
|
|
||||||
@@ -287,4 +276,3 @@ Note that `gwip` and `gunwip` are aliases, but are also documented here to group
|
|||||||
|
|
||||||
| Command | Description | Reason |
|
| Command | Description | Reason |
|
||||||
| :------------------- | :-------------------------------------- | :--------------------------------------------------------------- |
|
| :------------------- | :-------------------------------------- | :--------------------------------------------------------------- |
|
||||||
| `current_repository` | Return the names of the current remotes | Didn't work properly. Use `git remote -v` instead (`grv` alias). |
|
|
||||||
|
|||||||
@@ -8,14 +8,6 @@ git_version="${${(As: :)$(git version 2>/dev/null)}[3]}"
|
|||||||
# (order should follow README)
|
# (order should follow README)
|
||||||
#
|
#
|
||||||
|
|
||||||
# The name of the current branch
|
|
||||||
# Back-compatibility wrapper for when this function was defined here in
|
|
||||||
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
|
|
||||||
# to fix the core -> git plugin dependency.
|
|
||||||
function current_branch() {
|
|
||||||
git_current_branch
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check for develop and similarly named branches
|
# Check for develop and similarly named branches
|
||||||
function git_develop_branch() {
|
function git_develop_branch() {
|
||||||
command git rev-parse --git-dir &>/dev/null || return
|
command git rev-parse --git-dir &>/dev/null || return
|
||||||
@@ -110,7 +102,6 @@ function ggpnp() {
|
|||||||
}
|
}
|
||||||
compdef _git ggpnp=git-checkout
|
compdef _git ggpnp=git-checkout
|
||||||
|
|
||||||
alias ggpur='ggu'
|
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias ga='git add'
|
alias ga='git add'
|
||||||
alias gaa='git add --all'
|
alias gaa='git add --all'
|
||||||
@@ -290,7 +281,6 @@ alias gprom='git pull --rebase origin $(git_main_branch)'
|
|||||||
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
|
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
|
||||||
alias gprum='git pull --rebase upstream $(git_main_branch)'
|
alias gprum='git pull --rebase upstream $(git_main_branch)'
|
||||||
alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)'
|
alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)'
|
||||||
alias ggpull='git pull origin "$(git_current_branch)"'
|
|
||||||
|
|
||||||
function ggl() {
|
function ggl() {
|
||||||
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
|
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
|
||||||
@@ -334,7 +324,6 @@ is-at-least 2.30 "$git_version" \
|
|||||||
alias gpv='git push --verbose'
|
alias gpv='git push --verbose'
|
||||||
alias gpoat='git push origin --all && git push origin --tags'
|
alias gpoat='git push origin --all && git push origin --tags'
|
||||||
alias gpod='git push origin --delete'
|
alias gpod='git push origin --delete'
|
||||||
alias ggpush='git push origin "$(git_current_branch)"'
|
|
||||||
|
|
||||||
function ggp() {
|
function ggp() {
|
||||||
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
|
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
|
||||||
@@ -427,19 +416,16 @@ alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
|
|||||||
|
|
||||||
unset git_version
|
unset git_version
|
||||||
|
|
||||||
# Logic for adding warnings on deprecated aliases
|
# Logic for adding warnings on deprecated aliases or functions
|
||||||
local old_alias new_alias
|
local old_name new_name
|
||||||
for old_alias new_alias (
|
for old_name new_name (
|
||||||
# TODO(2023-10-19): remove deprecated `git pull --rebase` aliases
|
current_branch git_current_branch
|
||||||
gup gpr
|
ggpull ggl
|
||||||
gupv gprv
|
ggpur ggu
|
||||||
gupa gpra
|
ggpush ggp
|
||||||
gupav gprav
|
|
||||||
gupom gprom
|
|
||||||
gupomi gpromi
|
|
||||||
); do
|
); do
|
||||||
aliases[$old_alias]="
|
aliases[$old_name]="
|
||||||
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\"
|
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_name}%F{yellow}' is deprecated, using '%F{green}${new_name}%F{yellow}' instead.%f\"
|
||||||
$new_alias"
|
$new_name"
|
||||||
done
|
done
|
||||||
unset old_alias new_alias
|
unset old_name new_name
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ plugins=(... kubectl)
|
|||||||
| k | `kubectl` | The kubectl command |
|
| k | `kubectl` | The kubectl command |
|
||||||
| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
|
| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
|
||||||
| kaf | `kubectl apply -f` | Apply a YML file |
|
| kaf | `kubectl apply -f` | Apply a YML file |
|
||||||
|
| kapk | `kubectl apply -k` | Apply a kustomization directory |
|
||||||
| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
|
| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
|
||||||
| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
|
| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
|
||||||
| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
|
| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
|
||||||
@@ -26,6 +27,7 @@ plugins=(... kubectl)
|
|||||||
| | | **General aliases** |
|
| | | **General aliases** |
|
||||||
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
|
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
|
||||||
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
|
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
|
||||||
|
| kdelk | `kubectl delete -k` | Delete all resources defined in a kustomization directory |
|
||||||
| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) |
|
| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) |
|
||||||
| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) |
|
| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) |
|
||||||
| | | **Pod management** |
|
| | | **Pod management** |
|
||||||
@@ -88,7 +90,7 @@ plugins=(... kubectl)
|
|||||||
| kga | `kubectl get all` | List all resources in ps format |
|
| kga | `kubectl get all` | List all resources in ps format |
|
||||||
| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
|
| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
|
||||||
| | | **Logs** |
|
| | | **Logs** |
|
||||||
| kl | `kubectl logs` | Print the logs for a container or resource |
|
| klog | `kubectl logs` | Print the logs for a container or resource |
|
||||||
| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
|
| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
|
||||||
| | | **File copy** |
|
| | | **File copy** |
|
||||||
| kcp | `kubectl cp` | Copy files and directories to and from containers |
|
| kcp | `kubectl cp` | Copy files and directories to and from containers |
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
|
|||||||
# Apply a YML file
|
# Apply a YML file
|
||||||
alias kaf='kubectl apply -f'
|
alias kaf='kubectl apply -f'
|
||||||
|
|
||||||
|
# Apply a kustomization directory
|
||||||
|
alias kapk='kubectl apply -k'
|
||||||
|
|
||||||
# Drop into an interactive terminal on a container
|
# Drop into an interactive terminal on a container
|
||||||
alias keti='kubectl exec -t -i'
|
alias keti='kubectl exec -t -i'
|
||||||
|
|
||||||
@@ -36,6 +39,7 @@ alias kcgc='kubectl config get-contexts'
|
|||||||
# General aliases
|
# General aliases
|
||||||
alias kdel='kubectl delete'
|
alias kdel='kubectl delete'
|
||||||
alias kdelf='kubectl delete -f'
|
alias kdelf='kubectl delete -f'
|
||||||
|
alias kdelk='kubectl delete -k'
|
||||||
alias kge='kubectl get events --sort-by=".lastTimestamp"'
|
alias kge='kubectl get events --sort-by=".lastTimestamp"'
|
||||||
alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch'
|
alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch'
|
||||||
|
|
||||||
@@ -131,7 +135,7 @@ alias kga='kubectl get all'
|
|||||||
alias kgaa='kubectl get all --all-namespaces'
|
alias kgaa='kubectl get all --all-namespaces'
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
alias kl='kubectl logs'
|
alias klog='kubectl logs'
|
||||||
alias kl1h='kubectl logs --since 1h'
|
alias kl1h='kubectl logs --since 1h'
|
||||||
alias kl1m='kubectl logs --since 1m'
|
alias kl1m='kubectl logs --since 1m'
|
||||||
alias kl1s='kubectl logs --since 1s'
|
alias kl1s='kubectl logs --since 1s'
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ plugins=(... opentofu)
|
|||||||
|--------|------------------------------|
|
|--------|------------------------------|
|
||||||
| `tt` | `tofu` |
|
| `tt` | `tofu` |
|
||||||
| `tta` | `tofu apply` |
|
| `tta` | `tofu apply` |
|
||||||
| `ttaa` | `tofu apply -auto-approve` |
|
| `tta!` | `tofu apply -auto-approve` |
|
||||||
| `ttc` | `tofu console` |
|
| `ttc` | `tofu console` |
|
||||||
| `ttd` | `tofu destroy` |
|
| `ttd` | `tofu destroy` |
|
||||||
| `ttd!` | `tofu destroy -auto-approve` |
|
| `ttd!` | `tofu destroy -auto-approve` |
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function tofu_version_prompt_info() {
|
|||||||
|
|
||||||
alias tt='tofu'
|
alias tt='tofu'
|
||||||
alias tta='tofu apply'
|
alias tta='tofu apply'
|
||||||
alias ttaa='tofu apply -auto-approve'
|
alias tta!='tofu apply -auto-approve'
|
||||||
alias ttc='tofu console'
|
alias ttc='tofu console'
|
||||||
alias ttd='tofu destroy'
|
alias ttd='tofu destroy'
|
||||||
alias ttd!='tofu destroy -auto-approve'
|
alias ttd!='tofu destroy -auto-approve'
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ plugins=(... terraform)
|
|||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
| Alias | Command |
|
| Alias | Command |
|
||||||
| ------- | -------------------------------------- |
|
|---------|----------------------------------------|
|
||||||
| `tf` | `terraform` |
|
| `tf` | `terraform` |
|
||||||
| `tfa` | `terraform apply` |
|
| `tfa` | `terraform apply` |
|
||||||
| `tfaa` | `terraform apply -auto-approve` |
|
| `tfa!` | `terraform apply -auto-approve` |
|
||||||
| `tfap` | `terraform apply -parallelism=1` |
|
| `tfap` | `terraform apply -parallelism=1` |
|
||||||
| `tfc` | `terraform console` |
|
| `tfc` | `terraform console` |
|
||||||
| `tfd` | `terraform destroy` |
|
| `tfd` | `terraform destroy` |
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ function tf_version_prompt_info() {
|
|||||||
|
|
||||||
alias tf='terraform'
|
alias tf='terraform'
|
||||||
alias tfa='terraform apply'
|
alias tfa='terraform apply'
|
||||||
alias tfaa='terraform apply -auto-approve'
|
alias tfa!='terraform apply -auto-approve'
|
||||||
alias tfap='terraform apply -parallelism=1'
|
alias tfap='terraform apply -parallelism=1'
|
||||||
alias tfc='terraform console'
|
alias tfc='terraform console'
|
||||||
alias tfd='terraform destroy'
|
alias tfd='terraform destroy'
|
||||||
alias 'tfd!'='terraform destroy -auto-approve'
|
alias tfd!='terraform destroy -auto-approve'
|
||||||
alias tfdp='terraform destroy -parallelism=1'
|
alias tfdp='terraform destroy -parallelism=1'
|
||||||
alias tff='terraform fmt'
|
alias tff='terraform fmt'
|
||||||
alias tffr='terraform fmt -recursive'
|
alias tffr='terraform fmt -recursive'
|
||||||
|
|||||||
Reference in New Issue
Block a user