config/git: migrate tag helpers
This commit is contained in:
parent
7155fb1e78
commit
de517fa921
3 changed files with 9 additions and 12 deletions
|
@ -55,18 +55,6 @@ git() {
|
|||
command git "$@"
|
||||
}
|
||||
|
||||
# BRANCHES
|
||||
# Remove list of tags local & remote
|
||||
gitrmtag() {
|
||||
declare -a refs
|
||||
local index=1
|
||||
for tag in $@; do refs[index++]=":refs/tags/$tag"; done
|
||||
git push origin "${refs[@]}" && git tag -d "$@"
|
||||
}
|
||||
# Rename a tag
|
||||
gitretag() {
|
||||
git push origin refs/tags/${1}:refs/tags/${2} :refs/tags/$1 && git tag -d $1
|
||||
}
|
||||
|
||||
# Testing
|
||||
gittestcommit() { touch file$((++i)) && git add 'file*' && git commit -m "Create file$i"; }
|
||||
|
|
3
.local/bin/scripts/git-retag
Executable file
3
.local/bin/scripts/git-retag
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
# Rename a tag
|
||||
git push origin refs/tags/${1}:refs/tags/${2} :refs/tags/$1 && git tag -d $1
|
6
.local/bin/scripts/git-rmtag
Executable file
6
.local/bin/scripts/git-rmtag
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash -e
|
||||
# Remove list of tags local & remote
|
||||
declare -a refs
|
||||
index=1
|
||||
for tag in $@; do refs[index++]=":refs/tags/$tag"; done
|
||||
git push origin "${refs[@]}" && git tag -d "$@"
|
Loading…
Add table
Reference in a new issue