Delete remote branch:
git push origin :<branchName>
Add a remote branch:
git remote add <remoteName> <gitAddress>
Remove local branches that are no longer on origin:
git fetch --prune
Add remote to existing local rep, and track master:
git remote add --track master origin [email protected]:abc/123.git
Showing remotes:
git remote -v
Set remote repo:
git remote set-url origin [email protected]:account/whatever.git
Undo previous commit:
git revert HEAD^
Modify previous commit message:
git commit --amend
Reset to the most recent commit
git reset --hard
Temporarily stash changes:
git stash
Restore changes from stash:
git stash pop
Delete changes in stash:
git stash drop
Show status with list modified/new/etc files:
git status -s
Add a new submodule:
git submodule add git@mygithost:repo path/to/dir
Update all the submodules (externals):
git submodule update --init --recursive