Skip to content

Instantly share code, notes, and snippets.

@CodinCat
Last active August 29, 2015 14:04
Show Gist options
  • Save CodinCat/f39c3167cd4450bc1947 to your computer and use it in GitHub Desktop.
Save CodinCat/f39c3167cd4450bc1947 to your computer and use it in GitHub Desktop.
Git force update and override everything from remote

Just take a note.

This will force update a local repository from a remote, and keep only 1 commit history.

git fetch {{remote}} {{branch}} --depth=1
git reset --hard FETCH_HEAD
git clean -df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment