Proposal: git hide -b <BASE>
- Hide entire subtree starting from the main branch
#1070
Closed
zachallaun
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
You probably want to check Reference: Revsets. On
If you have committed the feature branch upstream by rebase, then you can use |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
Let's say I'm working on a feature being contributed to another repository:
The feature is accepted and the maintainer squashes all commits and merges into main. After pulling, my tree looks like:
I'd now like to delete the
my-feature
branch and hide all commits. The easiest way to do this is:This is a nice one-liner, but if you have a lot of commits in that branch, it can involve scrolling up and copying the commit hash.
Proposal
I'd love to page a page from the book of
git move
and addgit hide -b
/git hide --base
. Likegit move -b
, it would hide from the "other direction", hiding the entire subtree between the main branch and the commit. Using this, the command above would become:Other thoughts
git hide -b my-feature
should deletemy-feature
by default, which (I think) you'd almost always want to do. This would make-D
redundant when using-b
with a branch, however, and may be surprising to some.Beta Was this translation helpful? Give feedback.
All reactions