Skip to content

Conversation

@MunifTanjim
Copy link

No description provided.

@linrongbin16
Copy link

hi @MunifTanjim ,

Seems ruifm doesn't maintain this repo any longer.

This feature is been implemented in my fork: https://github.com/linrongbin16/gitlinker.nvim.

@MunifTanjim
Copy link
Author

Hey @linrongbin16 , I looked into your fork a few days ago. But couldn't figure out how to provide a function to dynamically set remote.

@linrongbin16
Copy link

linrongbin16 commented Mar 12, 2024

Hey @linrongbin16 , I looked into your fork a few days ago. But couldn't figure out how to provide a function to dynamically set remote.

Type below command:

  • GitLink remote=upstream: copy the generated url to clipboard
  • GitLink! remote=upstream: open the generated url in browser.

The upstream is the remote configured in the git repository's .git/config.

For example in my gitlinker fork, the .git/config is:

image

There's only 1 configured remote: origin. So the GitLink and GitLink remote=origin are doing the same thing: they all generate the link for the origin remote (e.g. the repo hosted in GitHub).

Once your git repo contains multiple remote, the GitLink command will use the first detected remote, if you want to specify a remote, use GitLink remote=upstream will link you to the upstream remote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants