Last active
November 27, 2023 12:46
-
-
Save 1eedaegon/1362bd741604f36ce774143e0fb4ac37 to your computer and use it in GitHub Desktop.
How to get git remote path without semi colon
This file contains hidden or 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
# 1. | |
$(git remote -v | tail -1 | awk -F"@" '{print$2}' | awk -F".git" '{print$1}' | sed 's/:/\//g') | |
# 2. | |
$(git remote -v | sed -n '1p' | awk -F '@' '{print $2}' | sed -e 's/\:/\//g' | awk -F '.git' '{print $1}') | |
# example | |
❯ go mod init $(git remote -v | tail -1 | awk -F"@" '{print$2}' | awk -F".git" '{print$1}' | sed 's/:/\//g') | |
go: creating new go.mod: module github.com/1eedaegon/ory-practice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment