Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support function for option - remote #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

2 participants