paint-brush
How to Fix the "Detached HEAD" State in Gitby@marcinwosinek
1,892 reads
1,892 reads

How to Fix the "Detached HEAD" State in Git

by Marcin Wosinek6mNovember 9th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A common source of confusion when using Git is not knowing what it all means. Git commits are immutable, meaning you can create new ones, but what’s already inside will never be changed. The only way of making changes to the repository is by creating new commits. Git doesn’t have a branch to update when you create a new commit, so all the commits you a create there are **stored** but are dangling. At some point, the garbage collector will remove them permanently from the repository.

Company Mentioned

Mention Thumbnail
featured image - How to Fix the "Detached HEAD" State in Git
Marcin Wosinek HackerNoon profile picture
Marcin Wosinek

Marcin Wosinek

@marcinwosinek

I'm a JavaScript developer. I'm here to teach you useful skills, so you can succeed in your work & private projects.

Learn More
LEARN MORE ABOUT @MARCINWOSINEK'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Marcin Wosinek HackerNoon profile picture
Marcin Wosinek@marcinwosinek
I'm a JavaScript developer. I'm here to teach you useful skills, so you can succeed in your work & private projects.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here