git@ssh.dev.azure.com:v3/x86chi/repo
➡️https://dev.azure.com/x86chi/_git/repo
https://x86chi@dev.azure.com/x86chi/_git/repo
➡️https://dev.azure.com/x86chi/_git/repo
Last active
October 21, 2021 03:33
-
-
Save mu-hun/e8e51034f2a48178b740ac1ab0429cf6 to your computer and use it in GitHub Desktop.
Open Azure repo in Browser from git remote url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function az() { | |
open `git remote get-url origin | | |
perl -pe 's#^git\@ssh\.dev\.azure\.com:v3/(.*)/(.*)$|^https://.*@dev.azure.com/(.*)/_git/(.*)$#https://dev.azure.com/\1\3/_git/\2\4#g'` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
두 케이스 모두 처리해주면서, perl과 git을 각각 1회씩만 호출하는 버전
아래와 같이 두 케이스 모두 잘 처리하는것을 확인할 수 있음