Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(delete-tag): get default remote from git config if exists #889

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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