You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git-url [REMOTE] [REF] [--] [PATH]
Prints the GitHub URL of the specified item to standard output.
Arguments:
REMOTE Use the repository pointed at by the value. Defaults to master.
REF A branch, tag or commit
PATH A file path
Remarks:
If a PATH is given, the specified path is linked in the given REF, or if
not set, to the current branch, tag or commit (if detached).
If a PATH is not given, the REF itself is linked, or the repository itself
if not set.
When REMOTE or REF is ambiguous, both must be supplied. When PATH is
ambiguous, add a -- argument before it.
Examples:
$ git url
https://github.com/github/hub
$ git url myremote
https://github.com/myuser/hub
$ git url 2.2-stable
https://github.com/github/hub/tree/2.2-stable
$ git url 88296d1
https://github.com/github/hub/commit/88296d1
$ git url README.md
https://github.com/github/hub/blob/master/README.md
$ git url 2.2-stable README.md
https://github.com/github/hub/blob/2.2-stable/README.md
$ git checkout 2.2-stable
$ git url README.md
https://github.com/github/hub/blob/2.2-stable/README.md
$ git checkout 133ed4e
$ git url README.md
https://github.com/github/hub/blob/133ed4e/README.md
The text was updated successfully, but these errors were encountered:
This is a nice proposal. Although hub browse -u already covers some of these features, I definitely see a value in smart handling of when branch names, commit SHAs, or file names are passed.
I'm not so sold on this command being called git url, but I'm definitely open for making hub browse working more like this, or making a new command like hub open and deprecating hub browse.
I have to admit I wasn’t aware of hub browse. To me it seems like it could be extended for the above use cases with a handful of changes:
Adding a way to specify a remote from which the user and repository should be inferred, perhaps -r upstream or by changing the first positional argument to [REMOTE | [USER/]REPOSITORY], although that could lead to ambiguities
Making the [SUBPAGE] argument more flexible by accepting branches and tags, perhaps making the commit/, branch/, etc part optional, essentially making this [SUBPAGE|REF]
Adding a [PATH] argument. It would be good to be able to disambiguate from [SUBPAGE|REF]with -- but unfortunately that’s already used. Not sure what to do about that
The behaviour between [SUBPAGE|REF] and [PATH] would then be the same as in the proposal.
The text was updated successfully, but these errors were encountered: