added taglist alias and tagpush functions

This commit is contained in:
Bryan Joshua Pedini 2024-03-24 09:56:26 +01:00
parent 0eb28cf6cc
commit bea9c85c9a
2 changed files with 14 additions and 0 deletions

View File

@ -1,4 +1,5 @@
alias pubkey='for PUBKEY_FILE in $(ls ~/.ssh/id_*.pub); do echo "${PUBKEY_FILE} :" | sed -e "s/.*id_//;s/\.pub//"; cat "${PUBKEY_FILE}"; echo; done'
alias taglist='git tag | tr - \~ | sort -V | tr \~ -'
alias hosts='sudo nano /etc/hosts'
alias historygrep='history | grep'
alias sshconfig='nano ~/.ssh/config'

View File

@ -21,3 +21,16 @@ __git_prompt() {
__git_history() {
echo "$(git log --oneline | cut -d ' ' -f 1)"
}
tagpush() {
if [ -z "$1" ]; then
echo "Usage: tagpush <tag>"
return
fi
git tag "$1"
# for every remote
for REMOTE in $(git remote) ; do
# push current branch and newly created tag
git push "$REMOTE" $(git branch | grep "*" | sed 's/\* //') "$1"
done
}