2021-07-27 20:07:51 +00:00
|
|
|
---
|
|
|
|
author: Alvie Rahman
|
|
|
|
date: \today
|
|
|
|
title: Git notes
|
2021-08-15 19:44:51 +00:00
|
|
|
tags: [ linux, programming, git ]
|
2021-07-27 20:07:51 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
# Fix detached head
|
|
|
|
|
|
|
|
From https://stackoverflow.com/a/10229202 :
|
|
|
|
|
|
|
|
## To Delete Changes
|
|
|
|
|
|
|
|
```
|
|
|
|
git checkout main
|
|
|
|
```
|
|
|
|
|
|
|
|
## To Keep Changes
|
|
|
|
|
|
|
|
```
|
|
|
|
git branch temp
|
|
|
|
git checkout main
|
|
|
|
git pull . temp
|
|
|
|
git branch -D temp
|
|
|
|
```
|