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

Git Work trees Auto Merging master / Not setting branches correctly #118

Open
nick22985 opened this issue Jan 22, 2024 · 0 comments
Open

Comments

@nick22985
Copy link

I am trying to use git-worktree.nvim (or worktrees in general neither ways work)

  1. git clone --bare [email protected]:/ ./
  2. git worktree add ./path/ (or do it in the git worktree nvim menu)
  3. cd path
  4. git reset --soft HEAD~1 (to mimic a state that needs pulling)
  5. git pull (this pulls down the master branch and merges it with current branch

I have tried setting git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" which fixes the issue of pulling

However this causing all the branches to now have origin/ in them. Now trying to use git worktrees nvim to download a new worktree. Causes them to download origin/ if no path is specified. If I specify a path it will create it but the branch is not linked it says to do this in the git help message when pulling

git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> origin/<branch>

doing what the command says here git branch --set-upstream-to=origin/<branch> origin/<branch> leads me to another error

git branch --set-upstream-to=origin/<branch> origin/<branch>
warning: refname 'origin/<branch>' is ambiguous.
fatal: ambiguous object name: 'origin/<branch>'

Does anyone know what is going on here or how to properly use work trees in a bare repo and have all the branches able to be pulled / updated / downloaded correctly?

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

1 participant