:Gbrowse when on remote
First of all; Thank you for your awesome work making developing so much more fun for all of us!
I currently started developing on a remote machine, and pretty much got everything working as it was on my local machine.
I'm missing one thing, though; :Gbrowse.
Often because I'm looking at some specific lines of code, and want to send a link to my colleague like this:
https://github.com/org/repo/blob/master/file#L3-L5
I've tried setting up git web--browse to use lynx, but that doesn't seem to work.
All I need is that URL, so I can copy it, and send it off to someone else.
Do you have any suggestions as to how I might go about doing that?
Again, thank you.
Anders
Uhm, :Gbrowse! apparently does the trick. :)
I'm sorry to waste your time.
Forget everything after "Thank you"...
I've been looking for this for a while. I was sure Gbrowse used to work without the bang. Anyways, it does the trick. Thanks
Looking for it in 2024. Can't believe it's so simple. Thanks.
:Gbrowse has been removed in favor of :GBrowse
I thought GBrowse wouldn't work with remotes different that origin, but then I found:
:GBrowse [...]@{remote} Force using the given remote rather than the remote
for the current branch. The remote is used to
determine which upstream repository to link to.
It would be awesome though if this used the "default remote", (i.e. git config remotes.default <remote>), because often my remotes names are set through google's repo tools, and hard to remember/type
It would be awesome though if this used the "default remote", (i.e.
git config remotes.default <remote>)
I don't see remotes.default anywhere in the git-config manpage.
remotes.default
Hmm, I think I originally got that from an SO answer.. I do see it discussed on the git-remote page:
If neither group nor remote is specified on the command line, the configuration parameter
remotes.defaultwill be used; ifremotes.defaultis not defined, all remotes which do not have the configuration parameter
It's been super helpful for me, we have build systems that define a bunch of remotes, so with this I can set the real one I'm interested in as the default for git push/pull/fetch
Okay, so this remotes.default is a list of remotes that only affects git remote update with no arguments.
It's been super helpful for me, we have build systems that define a bunch of remotes, so with this I can set the real one I'm interested in as the default for
git push/pull/fetch
Best I can tell it has zero effect on any of these commands. It's not clear what the effect would even be, since these commands only act on a single remote, not a list.
Best I can tell it has zero effect on any of these commands. It's not clear what the effect would even be, since these commands only act on a single remote, not a list.
Hmm, this is embarrassing. I was about to copy/paste an example where I show this controlling what remote gets fetched from, but I figured I'd double check my aliases just to ensure I didn't have anything special going on.
Turns out I did replace my gf alias with a shell function that defaults the remote to the value of remotes.default config setting (that I also set.) So it seems that in 2021 I abstracted this and totally forgot.
Sorry about that.