less big rename
This commit is contained in:
42
computery_stuff/git.md
Executable file
42
computery_stuff/git.md
Executable file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Git
|
||||
tags: [ linux, programming, git ]
|
||||
---
|
||||
|
||||
|
||||
# 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
|
||||
```
|
||||
|
||||
# Retroactively Sign Commits
|
||||
|
||||
From <https://webdevstudios.com/2020/05/26/retroactively-sign-git-commits/>:
|
||||
|
||||
1.
|
||||
```
|
||||
git rebase -i HEAD~<number of commits to sign>
|
||||
```
|
||||
|
||||
2. Replace `pick` with `reword`:
|
||||
|
||||
In vim: `:%s/^pick/reword/:wq`
|
||||
|
||||
3. Save all commit messages
|
||||
4. Force push to remote
|
Reference in New Issue
Block a user