# Git ## Cheat Sheet ### Fast Rebase - `git fetch origin master:master` - `git rebase master` ### Generate Format Patch - `git format-patch --root` ### Apply Format Patch - `git am *` ### Backup Remote Repo - `git clone --bare OLD_REMOTE/PROJECT_NAME` - `cd PROJECT_NAME.git` - `git push --mirror NEW_REMOTE/PROJECT_NAME` ### Deletes Stale Remote-tracking Branches - Method 1 - `git remote prune origin` - Method 2 - `git pull --prune` - Method 3 - `git fetch -p` ### Rename Branch - `git branch -m NEW_BRANCH_NAME` ### Worktree - `git worktree list` -
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up