To tag a commit and use the commit date for the tag:
git checkout <commit hash>
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag <tag name>
To fix commit timestamps:
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"'
To force push a subtree to a remote:
git subtree split --prefix [FOLDER_NAME] -b [BRANCH_NAME]
git push -f origin [LOCAL_BRANCH_NAME]:[REMOTE_BRANCH_NAME]
The filter-branch command I bulk fixed Albert's commits with:
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "your previous name" ];
then export GIT_AUTHOR_NAME="your New Name"; export [email protected];
export GIT_COMMITTER_NAME="your New Name"; export [email protected]
fi; git commit-tree "$@"'
To make git detect a bunch of renames:
git add . -A
To rebase the last N commits of a branch A onto another branch B
git rebase -i --onto B A~N A
git rebase -i --onto develop sbansal/drop-schema-versions~3 sbansal/drop-schema-versions