git log --branches --not --remotes --no-walk --decorate --oneline
(or after your working copy of a branch gets out of sync with the remote branch for any reason)
git fetch
# discards local changes
git reset origin/<branch_name> --hard
# preserves local changes
git reset origin/<branch_name> --soft
# https://gist.github.com/jasonrudolph/1810768
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r```
% GIT_SSH_COMMAND="ssh -vvv" git ...
- Enter interactive rebase
- Choose 'edit' for for the commit(s) that need the author amended
- Initiate rebase
- foreach commit:
% git commit --amend --author="Firstname Lastname <email>" --no-edit
% git rebase --continue
- Force push branch
- Set local config in repo
git config user.name "<USERNAME>"
git config user.email "<EMAIL>"
-
Change ~/.ssh/config to use other SSH key
-
Stop
ssh-agent
kill -9 ssh-agent
- Add other SSH key
ssh-add -K ~/.ssh/<KEY>