Replies: 2 comments 3 replies
-
When you run
That's interesting! There was some discussion of a similar topic in #283, and I think that the outcome was that such squashed "merge" commits were hard to detect w/o some combo of a workflow change and new logic in git-branchless. That was a while ago (before |
Beta Was this translation helpful? Give feedback.
-
The easiest way is probably to squash the commits in your PR locally, (force-)push the new PR contents to GitHub, and then do the merge (or squash merge) in GitHub, so that git-branchless can track the contents of the squashed commits. Then your You could also try a tool like https://github.com/hartwork/git-delete-merged-branches, which might be able to detect the squash after the fact. It would be nice to have logic like that in git-branchless, but it's currently not implemented. |
Beta Was this translation helpful? Give feedback.
-
Hello! In most of the repos I work on, the PR flow is something like:
I use a basic
gh
alias for step 5, which looks like:sm: '!gh pr merge --delete-branch --squash && git pull && git fetch -p'
, so I just rungh sm
and it squash merges the PR, deletes the branch, and pulls in the latest changes.This flow works excellent with git-branchless, the trouble comes after, as my next command is usually
git sync
to bring all the other branches up to date. If the branch I just merged was only a single commit, it correctly gets swept into the dustbin and disappears fromgit sl
, but if it was multiple commits, I get a merge error, like:Which makes sense, as the squashed commit doesn't look like the first commit of that branch. I then manually run
git hide -r <first commit of branch>
, and all is well again.My question: is there a magic incantation (or workflow change) I can do to make this issue go away? It's tedious having to manually 'clean up' old branches by typing commit hashes 10 times a day, and theoretically, the tooling could recognize that a branch is equivalent to a series of commits and appropriately remove them post-
sync
.Beta Was this translation helpful? Give feedback.
All reactions