[FR] Pleas add create worktree base on remot-branch
but you can creat a branch and set the upstream😅, then you can get a branch base that remote,
eeeerrr
If you want to create a worktree by checking out a remote branch. You should use Create New Branch method to add worktree, and then input the remote branch name (you can copy it from context menu).
For example:
Entry: Popup
-
base current branch
name: user input error: if name exits in local branch, ERROR -
use local branch name: user select error: if a worktree named as that branch has checkouted, ERROR
-
use remote branch name: user select a. if a local branch has the same name, use the local branch, then check the local branch status error: if the local branch is related to a worktree, Error
b. if no local branch named it, creat a local branch and auto set the upstream this remote branch
Entry: Commit
- Select a commit and open the menu
- creat a local branch base select commit and then create a worktree
This is a limitation of Git itself: a branch can only be checked out in one worktree, and the same branch cannot be checked out in multiple worktrees. If you need a worktree for a remote branch, you should first check out this remote branch locally and then use the "Existing Branch" option to check it out—or choose the "Create New Branch" option and set the upstream branch.
a branch can only be checked out in one worktree
yes ,we get this
as I notice above, we are trying to make a useful and comfortable way to create worktree without Too many steps
I have sorted out three scenarios, and each scenario has its own processing method to ensure uniqueness. Moreover, the interface will be very convenient to use, without the need for additional steps as you mentioned.
sort out the scene and clarify the train of thought, We just need to make some changes to handle these scenarios very well,