Skip to content

Instantly share code, notes, and snippets.

@bytefade
Last active November 12, 2015 00:00
Show Gist options
  • Save bytefade/268ed14825a83a4d9101 to your computer and use it in GitHub Desktop.
Save bytefade/268ed14825a83a4d9101 to your computer and use it in GitHub Desktop.
Comandos que mais uso no GIT

Remover arquivos deletados, faz um filtro:

  • git diff --name-only --diff-filter=D -z | xargs -0 git rm --cached

Remover, parar de versionar arquivos individuais:

  • git rm nameFileHere --cached

Exportar log de commit para csv:

  • git log --since='last month' --pretty=format:'%h,%an,%ar,%s' > log.csv

    com os arquivos:

  • git log nailton --pretty="format:" --name-only

  • git log nailton --pretty=format:'%h,%an,%ar,%s' --name-status > log3.csv

Zip do master:

  • git archive -o nameFile.zip HEAD

Voltar estagio apos git add:

  • git reset HEAD

remover untracking files:

  • git clean -f

Mas antes é bom rodar git clean -f --dry-run para ver quais arquivos entram

Filtro pelo nome do autor:

  • git log --author="Jon"

Número total de commits:

  • git log --oneline --all | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment