Open matheusamazonas opened 1 week ago
I was not able to reproduce this issue on Fork:
But I was able to reproduce it on:
So it seems that 2.45.X broke it for me.
Do you mean worktrees (git feature) or worspaces (the ability to manage tabs in Fork)?
Starting 2.45, if a branch is tied to a worktree, instead of checkout Fork opens corresponding worktree repo in a new tab.
Sorry, I meant worktrees.
I understand the 2.45 behavior, but that does not happen. Nothing happens if I try the check the develop
branch out. A new tab is opened if I try to check the master
branch out, but not develop
.
I also did not expect a new tab to be opened when I try to check develop
out, because that's the branch that my current worktree is based off. I just want to check the branch out.
Thank you for the details. Let me have a look.
Can you open 'Worktrees' section on the sidebar and check which worktree is on the develop
branch? Can you open this worktree?
On Fork 2.46.2, this is what my sidebar looks like:
corpus-vr-headset-develop
worktree, in the feature/blokki_review
branch.develop
branch out, nothing happens.master
branch out, a new tab in the corpus-vr-headset-master
(which has the master
branch checked out) is opened. corpus-vr-headset-master
worktree) tab, if I try to check the develop
branch out, nothing happens.It's also worth noting that before jumping to the feature/blokki_review
branch, my corpus-vr-headset-develop
worktree was on the develop
branch. I just can't switch back to it.
Check tooltips over the worktree items. Does any of them track 'develop'?
No.
corpus-vr-headset-develop
worktree is tracking feature/blokki_review
.corpus-vr-headset-master
worktree is tracking master
.Can you send me an email (support@fork.dev) and I'll send you a debug build with verbose logging, please?
Any updates on this? Were you able to reproduce the bug?
Well, as you and I found out, the parent repo Development
is on the develop
branch, even though it's a bare repo.
I didn't check if Fork can recognize whether parent repo is bare yet, but you can fix the problem by changing the active branch in the Development
repo.
If I understood correctly, bare repos can't be checked out and they are never in a branch. The following commands don't work in bare repos:
work@Matheus-MBP corpus-vr-headset % git status
fatal: this operation must be run in a work tree
work@Matheus-MBP corpus-vr-headset % git checkout master
fatal: this operation must be run in a work tree
And just to confirm my folder structure: the Development
folder isn't a git repository:
work@Matheus-MBP ~ % cd ~/Development
work@Matheus-MBP Development % git status
fatal: not a git repository (or any of the parent directories): .git
The Development/corpus-vr-headset
is a bare git repository:
work@Matheus-MBP Development % cd ~/Development/corpus-vr-headset
work@Matheus-MBP corpus-vr-headset % git worktree list
/Users/work/Development/corpus-vr-headset (bare)
/Users/work/Development/corpus-vr-headset/corpus-vr-headset-develop f483f191f [develop]
/Users/work/Development/corpus-vr-headset/corpus-vr-headset-master 51cff94d3 [master]
work@Matheus-MBP corpus-vr-headset % git status
fatal: this operation must be run in a work tree
bare repos can't be checked out and they are never in a branch.
Bare repos have active branch.
Here is how to change it: https://stackoverflow.com/questions/3301956/git-correct-way-to-change-active-branch-in-a-bare-repository
if you want the default branch to be something other than master, you need to do this:
git symbolic-ref HEAD refs/heads/mybranch
Bare repos have active branch.
Interesting. TIL.
Anyway, that fixed it. Thank you!
I will close this issue because my problem was solved, but it would be nice if Fork could somehow identify it in the future. Otherwise, it seems like the app just isn't responding to my commands and that is quite frustrating. I know that worktrees are not that common, and bare ones even less, but I can imagine that I won't be the first one to run into this issue.
I'll keep it open if you don't mind. We need to check if this can be fixed.
it would be nice if Fork could somehow identify it in the future
👍
I am facing this same issue on two different repositories. I have a branch named
develop
and I am not aware to switch to it. I've tried double clicking on the branch name and also right clicking and selecting "Checkout develop". Nothing happens. The history doesn't contain acheckout develop
attempt. There is no progress bar or any popup displayed.I can check every other branch out, but not
develop
. I have a hunch that this might be related to worktrees because the only repositories that I can reproduce this issue are the ones that I have worktree set up, and the worktree I'm currently using was based on thedevelop
branch. Here's a list of all the branches I currently have:If I try to checkout another branch that has a worktree setup (like
master
), a new Fork tab is opened in that workspace.Fork versions I could reproduce the issue:
macOS 14.6.1.