- renomear mensagem do último commit:
git commit --amend -m "New commit message."
- reverter commit:
git reset HEAD~
- deletar branch localmente:
git branch -d <branch_name>
- deletar branch remotamente:
git push origin --delete <branch_name>
- correção ultimo commit
git commit --amend
- mostrar URL remoto atual:
git remote -v
- mudar URL remoto:
git remote set-url <remote_name> <remote_url>
example:
git remote set-url origin https://git-repo/new-repository.git
- adicionar a chave ao ssh-agent (Mac ou Linux)
eval $(ssh-agent)
ssh-add ~/.ssh/<private_key_file>
- exemplo url remoto requisição https que não precisa passar a senha sempre:
git remote set-url origin https://<user>:<password>@git-repo/new-repository.git
- correção erro ao fazer PULL: fatal: Not possible to fast-forward, aborting.
git pull --no-ff
- padrão de commits: