Skip to content

Commit

Permalink
Merge pull request #889 from vanpipy/feature/delete-tag
Browse files Browse the repository at this point in the history
feat(delete-tag): get default remote from git config if exists
  • Loading branch information
spacewander authored Nov 12, 2020
2 parents ad8c77b + c006e5e commit d2a159e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/git-delete-tag
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
# Assert there is at least one tag provided
test -z $1 && echo "tag required." 1>&2 && exit 1

# Detect the defalt remote exists or not
defualt_remote=$(git config git-extras.default-remote)

if [[ -n "$defualt_remote" ]]; then
origin="$defualt_remote"
else
origin=origin
fi

# Concatenate all the tag references
local_tags=""
origin_refs=""
Expand All @@ -14,4 +23,4 @@ done

# Delete all the tags
git tag -d $local_tags
git push origin $origin_refs
git push $origin $origin_refs

0 comments on commit d2a159e

Please sign in to comment.