You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to insert d immediately after a (origin/master), i.e. I'd like to pop d to the top of my stack of local commits, retaining the linear graph:
a (origin/main)
d
b
c
I know I can do this with git rebase -i, but that has all the well-known downsides of rebase discussed in the git-branchless docs.
Does git-branchless support this operation directly? Or do I need to do git move -s d -d a to get to
a (origin/master)
|\
| b
| |
| c
d
and then git move -s b -d b to get to the desired end state? That's not the most onerous workflow in the world, but popping/inserting a commit at the top of the local stack seems like a common code review workflow so I'm wondering if there is (or could be) a oneliner for this.
Thanks to @claytonrcarter, in the latest master, you can run git move -I -x d -d a (git move --insert --exact d --dest a) to insert d just after a.
In this case, --exact is the same as --source, but it would be different if d had a descendant commit that you didn't want to move. I'm guessing that for rearranging workflows, you probably want to use --exact instead of --source.
Thanks to @claytonrcarter, in the latest master, you can run git move -I -x d -d a (git move --insert --exact d --dest a) to insert d just after a.
In this case, --exact is the same as --source, but it would be different if d had a descendant commit that you didn't want to move. I'm guessing that for rearranging workflows, you probably want to use --exact instead of --source.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Thanks to @claytonrcarter, in the latest
master
, you can rungit move -I -x d -d a
(git move --insert --exact d --dest a
) to insertd
just aftera
.In this case,
--exact
is the same as--source
, but it would be different ifd
had a descendant commit that you didn't want to move. I'm guessing that for rearranging workflows, you probably want to use--exact
instead of--source
.