Open edgimar opened 3 years ago
Instead, git-link should be able to correctly identify the remote and branch.
How to do that?
In the particular case this was tested under, the foo repository didn't even have an origin remote (but did have other remotes).
If git-link-default-remote
nor git-link.remote
are set, some place in the code will default to origin
.
Closing . If the above git-link*
options do not work for you feel free to reopen.
Ok thanks for the information - I believe that the problem has something to do with git-link not being able to determine what the upstream repository and tracked branch is in the case when a "git-worktree" branch is being used. If I have more time to investigate, and find out anything more specific, I'll reopen.
FWIW, I routinely use git-link
with worktrees. It reliably finds the branch I am on. Since my remote is called origin
, I would not have observed any issue determining the remote.
Given a git repository contained in the folder
foo
, if (from this folder) the commandgit worktree add ../foo-worktree-otherbranch otherbranch
is executed, a worktree will be created for theotherbranch
branch in the folder../foo-worktree-otherbranch
(relative to thefoo
folder).When editing a file within the
foo-worktree-otherbranch
folder, and attempting to usegit-link
, the errorRemote 'origin' not found
occurs. Instead,git-link
should be able to correctly identify the remote and branch. In the particular case this was tested under, thefoo
repository didn't even have anorigin
remote (but did have other remotes).