bash: check if a particular git repository has github as remote repo?
I was wondering if it is, at all, possible to check开发者_高级运维 if a git repository is using github.com as remote repository, and get the url for it via bash?
Any help will be appreciated.
You can try a:
git remote -v show
And see if a "github
" address pops up in set of tracked repositories.
Doing a git config -l
works as well in the work-tree
However, it still isn't successful for ssh-alias, as Paulo Ebermann pointed out.
Sample Output:
remote.origin.url=git@github.com:nikhgupta/cli-poster.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
精彩评论