Stoic
Stoic

Reputation: 10754

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.

Upvotes: 2

Views: 330

Answers (2)

Stoic
Stoic

Reputation: 10754

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:

[email protected]:nikhgupta/cli-poster.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

Upvotes: 0

VonC
VonC

Reputation: 1324278

You can try a:

git remote -v show

And see if a "github" address pops up in set of tracked repositories.

Upvotes: 4

Related Questions