feat(git): add support for git url aliases #633
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone,
I propose a small improvement for your great tool 😊
In my git config, I implemented some git url aliases including the following one:
[url "git@github.com:"] insteadOf = "gh:"
Which allows me to clone like this:
git clone gh:SuperITMan/stark.git
.If I want to get the url of my remote with
git remote -v
, I obtain:But in release-it, currently, when the tool tries to get the remote url, it uses the command
git config --get remote.origin.url
which givesgh:SuperITMan/stark.git
instead ofgit@github.com:SuperITman/stark.git
.See the error I get when I try to do a release (the url is wrong and GITHUB_TOKEN variable is useless):
The command
git remote get-url <remote_name>
is apparently available since Git 2.7 according to https://stackoverflow.com/a/32991784