Skip to content

Commit 60cd64e

Browse files
committed
Update images to those hosted in another repo
1 parent aca79da commit 60cd64e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_posts/2025/2025-04-17-git-gone.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Cleaning up gone branches"
33
description: "A git alias to clean up gone branches. Even ones that have been squashed and merged."
44
tags: [git]
5-
image: https://github.com/user-attachments/assets/2859e82a-85b4-4745-af4c-bdf62db9565e
5+
image: https://haacked.github.io/images/blog/2025-04-17-git-gone/crushed-cars.png
66
---
77

88
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
1515

1616
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.
1717

18-
![Image of a set of cars being squashed together](https://github.com/user-attachments/assets/2859e82a-85b4-4745-af4c-bdf62db9565e)
18+
![Image of a set of cars being squashed together](https://haacked.github.io/images/blog/2025-04-17-git-gone/crushed-cars.png)
1919

2020
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.
2121

@@ -25,11 +25,11 @@ But here's the thing about Git. There's almost always a way.
2525

2626
When you merge a PR on GitHub, it shows you a "Delete branch" button:
2727

28-
![image of a delete branch button](https://github.com/user-attachments/assets/b972f11c-985e-4586-874b-b57575ecebdc)
28+
![image of a delete branch button](https://haacked.github.io/images/blog/2025-04-17-git-gone/delete-repo.png)
2929

3030
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:
3131

32-
![image showing configuring a repository to automatically delete head branches](https://github.com/user-attachments/assets/b73144f6-b457-4f13-b092-933a8aac27dd)
32+
![image showing configuring a repository to automatically delete head branches](https://haacked.github.io/images/blog/2025-04-17-git-gone/automatically-delete.png)
3333

3434
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:
3535

0 commit comments

Comments
 (0)