.git Gut
Posted at:
Updated:
Common mistake or notes for .git during work
My .git notes or remainder during work
- To rename cherry-pick commit
git cherry-pick -e <hash>
- Error swap
Found a swap file by the name "/directory/.../blabla/.git/.COMMIT_EDITMSG.swp
Type this to fix: rm .git/.COMMIT_EDITMSG.swp
- 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
becomeREADME.md
git config core.ignorecase false
- 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.
- Setup .git config locally:
git config --local user.name "Your Name Here"
git config --local user.email your@email.example