mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-22 19:16:07 +02:00
feat(git): add gbcopy (#13847)
Signed-off-by: NunzioFornitto <FRNNNZ00C24B202G@studium.unict.it>
This commit is contained in:
@@ -49,6 +49,16 @@ function git_main_branch() {
|
||||
return 1
|
||||
}
|
||||
|
||||
function gbcopy() {
|
||||
command git rev-parse --git-dir &>/dev/null || return
|
||||
|
||||
local branch
|
||||
branch="$(git_current_branch)" || return
|
||||
[[ -n "$branch" ]] || return 1
|
||||
|
||||
print -rn -- "$branch" | clipcopy
|
||||
}
|
||||
|
||||
function grename() {
|
||||
if [[ -z "$1" || -z "$2" ]]; then
|
||||
echo "Usage: $0 old_branch new_branch"
|
||||
|
||||
Reference in New Issue
Block a user