Skip to content

Instantly share code, notes, and snippets.

@lucasbuetto
Last active June 4, 2020 14:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasbuetto/47d3b1f9d330203c540fc7124a49ef4b to your computer and use it in GitHub Desktop.
Save lucasbuetto/47d3b1f9d330203c540fc7124a49ef4b to your computer and use it in GitHub Desktop.
Git local clear and update

Limpeza e atualização do histórico do git

IMPORTANTE! Antes de executar essas ações, garanta que seu trabalho já tenha sido enviado para o servidor.

Remove a pasta .git

  • rm -rf .git

Reinicia o git

  • git init

Adiciona o link do repositório novamente

  • git remote add origin [url do repositório]

Faz o download e atualiza os objetos e referências

  • git fetch --prune origin

Efetua um hard reset para branch master

  • git reset --hard origin/master

Remove pastas vazias dentro do projeto

  • git clean -f -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment