.git Gut

Common mistake or notes for .git during work

My .git notes or remainder during work

  1. To rename cherry-pick commit
git cherry-pick -e <hash>

  1. Error swap
Found a swap file by the name "/directory/.../blabla/.git/.COMMIT_EDITMSG.swp

Type this to fix: rm .git/.COMMIT_EDITMSG.swp


  1. To reset case-sensitive format, it work when you are working with Windows machine, some times .git didn’t detect changes if developer already rename files with same name but with different case type. i.e, readme.md become README.md
git config core.ignorecase false

  1. Temporary reset changes: Make some changes > git stash to make your working copy > Change branch / work on something else > git stash apply previous changes will be back.

  1. Setup .git config locally:

git config --local user.name "Your Name Here"
git config --local user.email your@email.example