hub
Extension to command-line git for GitHub
... will automatically detect the GitHub repository that the current working directory belongs to by scanning its git remotes. In case there are multiple git remotes that are all pointing to GitHub, hub assumes that the main one is named "upstream", "github", or "origin", in that order of preference.