feat(git): add gbcopy (#13847)

Signed-off-by: NunzioFornitto <FRNNNZ00C24B202G@studium.unict.it>
This commit is contained in:
Nunzio Fornitto
2026-09-16 10:39:06 +02:00
committed by GitHub
parent 6cd3a0baf6
commit 2ea948e05b
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -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"