Git yana ba ka damar sake rubuta tarihi — gyara, rebase, squash, ko kawar da commits — don tsatsa commits ko gyara matsala. Yana da karfi amma dole ne a yi shi da hankali: sake rubuta tarihin shared yana haifar da matsala mai tsanani, don haka ka'idoji game da shi suna da mahimmanci.
Hanyoyi na sake rubuta tarihi
git commit --amend → modify the most recent commit (message or content)
git rebase -i → squash, reword, reorder, edit, drop commits (interactive)
git rebase <branch> → replay commits onto another base (linear history)
git reset → move the branch pointer (discard/uncommit)
git filter-repo → rewrite MANY commits (remove a file/secret from all history)
→ All of these change commit HASHES (rewriting = creating new, different commits).
