Skip to content

Instantly share code, notes, and snippets.

@handersonbf
Last active October 2, 2015 16:58
Show Gist options
  • Select an option

  • Save handersonbf/992075 to your computer and use it in GitHub Desktop.

Select an option

Save handersonbf/992075 to your computer and use it in GitHub Desktop.
Comandos GIT
git shortlog -s | sort -rn | nl
Sincronizando master com outro branch.
no branch master, execute:
git rebase outroBranch
Ou para deixar a árvore de commits limpa.
git checkout master
git pull origin master
git merge -squash outroBranch
git commit -a -v && git push origin master
Deletar branch remote
git push origin :nomeBranch
------------------------------------------------------------------------------------
Script de shell para deixar os comentários do comando "git log" mais apresentáveis.
no arquivo /home/seu_user/.gitconfig
[alias]
lg = log --graph --pretty=format:'%Cred%h - %Cblue %s %Cgreen(%cr - %cD)%Creset - %an - %ae - %Cred%H' --abbrev-commit --date=relative
depois no console:
[handersonbf] ~/projetos/solr-test (master)
$ git lg
Voce pode criar quantos alias quiser.
------------------------------------------------------------------------------------
Comando para configurar o UTF nos commits do Git
git config --global i18n.commitEncoding 'utf8'
git config --global i18n.logOutputEncoding 'utf8'
Garante pelo menos que o que vai pro server quando comitar está apropriado.
------------------------------------------------------------------------------------------------
git config --global user.name "Handerson"
git config --global user.email "[email protected]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment