Use git config remote.origin.url to detect the origin.