Git ju lejon të rishkruani historikun — duke ndryshuar, ribazuar, ngjeshur ose hequr commit-e — për të pastruar commit-et ose për të rregulluar problemet. Është i fuqishëm por duhet bërë me kujdes: rishkrimi i historikut të ndarë shkakton probleme serioze, kështu që rregullat rreth tij janë kritike.
Mënyrat për rishkruimin e historikut
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).
