Source: https://stackoverflow.com/a/4982271/2731075
git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "incorrect@email" ]; then
GIT_AUTHOR_EMAIL=correct@email;
GIT_AUTHOR_NAME="Correct Name";
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all
Source: https://stackoverflow.com/q/46093437/2731075
git repack --max-pack-size=45m -a
When I get error trying to push git.backup
:
GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
Source: https://stackoverflow.com/a/10312587/2731075
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
Source: https://stackoverflow.com/a/795575/2731075
git --git-dir=git_directory status
Source: http://blog.dennisrobinson.name/push-only-one-commit-with-git/
git push <remote name> <commit hash>:<remote branch name>
Note: This will push all commits up to and including the specified commit
If you are on the branch you want to rename:
git branch -m new-name
If you are on a different branch:
git branch -m old-name new-name
git push origin :old-name new-name
Switch to the branch and then:
git push origin -u new-name