开发者

bash: check if a particular git repository has github as remote repo?

开发者 https://www.devze.com 2023-02-21 04:56 出处:网络
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?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消