git-machete-intellij-plugin
git-machete-intellij-plugin copied to clipboard
(đ) Ability to make a non-local parent branch
I don't really like having a local checkout of my parent branch (main). Having the parent branch be a remote branch would be my preferred workflow I think.
PS: Is this the right place to raise this? Or should it go on https://github.com/VirtusLab/git-machete?
Actually... such change would probably need to be reflected in both CLI and this plugin đ¤
TBH I've already done a PoC of that feature in CLI back in mid-2020, it worked quite reasonably well... but at the expense of:
- complicating the data model of git-machete (since the set of available operations differs b/w local and remote branches, e.g. the user shouldn't be able to rebase a remote branch)
- the feature of checking out a remote branch directly requires quite a lot of hacking, as git doesn't support something like
git checkout origin/masterâ I mean you can do that, but you just end up indetached HEADstate âšī¸ git only really supports checking out local branches, everything else (remote branches, tags,*_HEADs) just leads to detached HEAD
So! In a nutshell, it is surely doable, but I'd rather avoid implementing that for the sake of keeping the tool relatively simple and surprise-free... actually:
I don't really like having a local checkout of my parent branch
Could you elaborate more on the inconvenience? is it due to the fact that running Pull action on main doesn't fetch the other branches? (rel: #775)
I have absolutely no need for a copy of main branch to sit around and get out of date, I would rather just link the child branches directly to the origin/main. I want to be able to update my branch in a single click, I want a single button to make by branch up to date with origin/main, if not I have to update my local main, then update my branch.
If I checkout origin/master then I get a @detachhead? wacky!
We decided to drop this idea.
The reasons are similar as for (https://github.com/VirtusLab/git-machete-intellij-plugin/issues/241), so...
-
It would make things too complicated (for users). In particular sync to parent status refers to the status between local branches - in the case of the remote branch, none of the statuses is applicable; theoretically, a new status would be required.
-
Soon we will provide options (quick actions) within the machete file (https://github.com/VirtusLab/git-machete-intellij-plugin/issues/1232) - one will be able to easily checkout the remote branch.