Issue
alias git-repo="xdg-open '$(git config --get remote.origin.url | sed -e 's/:/\//g' -e 's/ssh\/\/\///g' -e 's/git@/https:\/\//g')'"
This alias works, but when I try to run it by hand it doesn't:
xdg-open '$(git config --get remote.origin.url | sed -e 's/:/\//g' -e 's/ssh\/\/\///g' -e 's/git@/https:\/\//g')'
What am I doing wrong?
Solution
You should not use variable expressions in single quotation marks. Try this instead:
xdg-open $(git config --get remote.origin.url | sed -e "s/:/\//g" -e "s/ssh\/\/\///g" -e "s/git@/https:\/\//g")
Answered By - yildirim Answer Checked By - Terry (WPSolving Volunteer)