Categories
Tags
asp.net azure azuredevops benchmarkdotnet c# cicd codecoverage copilot devops dotnet entityframework f# fluentvalidation flux git github gitops go hugo identityserver infosec javascript js linqpad markdown nerdfont oh-my-posh powershell PowerShell pwsh sonarlint starship terminal Testing verify visualstudio winget
129 words
1 minutes
Git commit back in the past
For a presentation I was holding at work I created a git commit timeline that could help me “cheat a little bit” as Ingrid Espelid Hovig would’ve put it.
However, I needed to go back in time and put something at the beginning of that commit timeline.
So - doing a commit between commit A and commit B:
- Start an interactive rebase to a commit at some point before the commit you want to insert after:
git rebase -i <commithash>
- Vim should start up and you’ll get a list of commits. Find the commit you want to add after and switch from pick to edit
- Save and exit vim
- Make the changes you want and do:
git add
andgit commit
- Continue the rebase:
git rebase --continue
Obviously the hardest part of this is step 3…
Git commit back in the past
https://cognitiveoverload.blog/posts/git/git-commit-in-the-past/