mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
feat(git): use git symbolic-ref in gbcopy and align README docs
This commit is contained in:
parent
40f8353eb0
commit
c04b6c826b
2 changed files with 3 additions and 3 deletions
|
|
@ -253,8 +253,8 @@ receive further support.
|
||||||
| `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 |
|
||||||
| `gbcopy` | Copy current branch name to clipboard |
|
| `gbcopy` | Copies current branch name to clipboard |
|
||||||
| `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**) |
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ function gbcopy() {
|
||||||
command git rev-parse --is-inside-work-tree &>/dev/null || return
|
command git rev-parse --is-inside-work-tree &>/dev/null || return
|
||||||
|
|
||||||
local branch
|
local branch
|
||||||
branch="$(git_current_branch)" || return
|
branch="$(command git symbolic-ref --short -q HEAD)" || return
|
||||||
[[ -n "$branch" ]] || return 1
|
[[ -n "$branch" ]] || return 1
|
||||||
|
|
||||||
print -rn -- "$branch" | clipcopy
|
print -rn -- "$branch" | clipcopy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue