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

not working for files in an auxiliary worktree (using git-worktree) #86

Open
edgimar opened this issue Jul 7, 2021 · 4 comments
Open

Comments

@edgimar
Copy link

edgimar commented Jul 7, 2021

Given a git repository contained in the folder foo, if (from this folder) the command git worktree add ../foo-worktree-otherbranch otherbranch is executed, a worktree will be created for the otherbranch branch in the folder ../foo-worktree-otherbranch (relative to the foo folder).

When editing a file within the foo-worktree-otherbranch folder, and attempting to use git-link, the error Remote '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, the foo repository didn't even have an origin remote (but did have other remotes).

@sshaw
Copy link
Owner

sshaw commented Jul 7, 2021

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.

@sshaw
Copy link
Owner

sshaw commented Jul 12, 2021

Closing . If the above git-link* options do not work for you feel free to reopen.

@sshaw sshaw closed this as completed Jul 12, 2021
@edgimar
Copy link
Author

edgimar commented Jul 14, 2021

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.

@sshaw sshaw reopened this Oct 26, 2021
@bergey
Copy link

bergey commented Mar 31, 2022

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.

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

No branches or pull requests

3 participants