Files
CLI-Notes/git.md
Rakshit Kumar Singh 25b1dfd497
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
change author of git commit
2026-04-22 18:28:29 +05:30

471 B

  1. Pushing a branch to a new branch in remote.
git push --set-upstream <remote-path> <new-branch-name>
  1. Remove uncommited changes.
git restore .
  1. Rename author
git filter-branch -f --env-filter '
NEW_NAME="<new-name>"
NEW_EMAIL="<new-email>"
export GIT_AUTHOR_NAME="$NEW_NAME"
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
' --tag-name-filter cat -- --all