Skip to content

Instantly share code, notes, and snippets.

@acaciomartins
Last active February 26, 2019 19:23
Show Gist options
  • Save acaciomartins/7219fa0ff1057679a589e9b6ac66b7de to your computer and use it in GitHub Desktop.
Save acaciomartins/7219fa0ff1057679a589e9b6ac66b7de to your computer and use it in GitHub Desktop.
Comandos GITs
URLs
===
http://rogerdudler.github.io/git-guide/index.pt_BR.html
Manual
======
rm -f ./.git/index.lock ==> para arquivo locado
git clone https://acaciomartins@bitbucket.org/sciensa/auto2.0-front.git
git branch
git checkout desenv
git branch
git checkout -b desconto-correntista (cria a branch desconto-correntista)
git branch (mostra branch atual)
git status
git add .
git status
git add .
git commit -m "Desconto correntista checkbox"
git push --set-upstream origin desconto-correntista
git commit -m "Mudança server-path prd=dev"
git push
git pull
git commit --amend ==> edita o texto do commit. Após esse comando um editor é aberto e a mensagem pode ser alterada.
git clean -fd (limpa toda sujeira)
============================================================================
git checkout -- <arquivo> (isto substitui as alterações na sua árvore de trabalho com o conteúdo mais recente no HEAD) atualiza por completo sua branch
--------
MUDAR DE REPOSITORIO REMOTO
--------
The ""git remote set-url"" command takes two arguments:
-----
Mostra os repositorios remotos
$ git remote -v
> origin git@github.com:USERNAME/REPOSITORY.git (fetch)
> origin git@github.com:USERNAME/REPOSITORY.git (push)
Switching remote URLs from SSH to HTTPS (Altera o repositorio para outro.
Ex.: alterar DE git@github.com:USERNAME/REPOSITORY.git PARA "https://github.com/USERNAME/REPOSITORY.git"
$ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment