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
A long time ago, I wrote a [useful set of git aliases](https://haacked.com/archive/2014/07/28/github-flow-aliases/) to support the GitHub flow. My favorite alias was `bdone` which would:
@@ -15,7 +15,7 @@ And this worked great for a long time. The way it worked was it would list all t
15
15
16
16
However, my aliases stopped working for me recently after joining PostHog. The main reason is on pretty much all of their repositories, they use Squash and Merge when merging PRs.
17
17
18
-

18
+

19
19
20
20
When you use `git merge --squash` or GitHub's "Squash and merge" feature, Git creates a new commit on the target branch that combines all the changes from the source branch into a single commit. This new commit doesn't retain any reference to the original commits from the source branch. As a result, Git doesn't consider the source branch as merged, and commands like `git branch --merged` won't show it.
21
21
@@ -25,11 +25,11 @@ But here's the thing about Git. There's almost always a way.
25
25
26
26
When you merge a PR on GitHub, it shows you a "Delete branch" button:
27
27
28
-

28
+

29
29
30
30
This is a great feature. It's a good way to clean up branches that have been merged into the default branch. In fact, you can configure GitHub to "Automatically delete head branches" when merged:
31
31
32
-

32
+

33
33
34
34
I highly recommend you do the same. When the remote branch is deleted, Git will track it as "gone". For example, if you run `git branch -vv` you'll see something like this:
0 commit comments