git-worktree

'<Branch>' is already checked out at '</other/location>' in git worktrees

泪湿孤枕 提交于 2019-11-27 17:15:36
问题 I started using git worktrees. It seems to work, but I'm getting this error when attempting to check out a branch in the cloned worktree: fatal: '<branch>' is already checked out at '</other/location>' How do I get around this without deleting the .git/worktrees directory? 回答1: Git won't let you check out the same branch twice, because if you do, and then go to one of the two work-trees and make a new commit, you'll set yourself up for misery when you go back to the other work-tree. If you

What would I use git-worktree for?

允我心安 提交于 2019-11-26 21:30:57
I read Github's post on git-worktree . They write: Suppose you're working in a Git repository on a branch called feature , when a user reports a high-urgency bug in master . First you create a linked working tree with a new branch, hotfix , checked out relative to master […] You can fix the bug, push hotfix, and create a pull request. When I'm working on a branch called feature and some high-urgency bug in master is reported, I usually stash away whatever I'm working on and create a new branch. When I'm done, I can continue working. This is a very simple model, I've been working like that for

What would I use git-worktree for?

▼魔方 西西 提交于 2019-11-26 07:58:10
问题 I read Github\'s post on git-worktree. They write: Suppose you\'re working in a Git repository on a branch called feature , when a user reports a high-urgency bug in master . First you create a linked working tree with a new branch, hotfix , checked out relative to master […] You can fix the bug, push hotfix, and create a pull request. When I\'m working on a branch called feature and some high-urgency bug in master is reported, I usually stash away whatever I\'m working on and create a new