Sunteți pe pagina 1din 2

/* SOFTWARES */

Instalar Git no Windows: http://msysgit.github.io/


Git para Eclipse (EGit): http://download.eclipse.org/egit/updates
Tortoise GIT: https://code.google.com/p/tortoisegit/downloads/list
Problemas com push no servidor:
Instalar libcurl-4.dll na pasta git/bin (somente se for solicitado):
http://www.dll-files.com/dllindex/dll-files.shtml?libcurl-4
http://stackoverflow.com/questions/5264949/cannot-push-git-to-remote-rep
ository-with-http-https
Na pasta do projeto, em .git/, mofidicar o arquivo config:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = http://git.repository.url/repo.git
para
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = http://username:password@git.repository.url/repo.git
/* COMANDOS BSICOS PARA GIT */
Fonte: http://rogerdudler.github.io/git-guide/index.pt_BR.html
Outra lista de comandos: http://blog.glaucocustodio.com/2013/03/06/git-nosso-decada-dia-git-cheatsheet/
Criar
Obter / Clonar
Obter / Clonar remoto

git init
git clone /path
user@server:/path

Adicionar

git add <arquivo>


git ad *
git commit -m "Comentrios..."
git commit --amend -m "Comentrio corrigido..."
git push origin master

Commit
Corrigir ltimo commit
Enviar altertaes
(master = branch)
Conectar local ao remoto
(se no foi clonado)

git remote add origin <servidor>

Criar branch
Retornar para master
Remover branch

git checkout -b nome_do_branch


git checkout master
git branch -d nome_do_branch
git branch -D nome_do_br
anch (a letra maiscula forou o delete. Porqu?)
Remover branch remoto
git push origin :<branch>
Enviar branch para repo
git push origin <nome_do_branch>
Remover arquivo do repo
git rm <arquivo>
git commit -m 'removido
<arquivo>'
git push</arquivo></arqu
ivo>
Criar tag
_opcional_do_comit> -m "Mensagem"
Criar tag no repo
Remover tag
Remover tag remot1

git tag -a <nome_da_tag> <numero


git push --tags origin master
git tag -d <nome_da_tag>
git push origin :<nome_da_tag>

Atualizar local
Mesclar alteraes
Se ouver merge manual,
corrigir e ento usar
Diff do branch
>

git pull
git merge <branch>
git add <arquivo>

Criar rtulo para release

git tag 1.0.0 1b2e1d63ff

git diff <branch_origem> <branch_destino

(git tag versao 10_prime


iros_caracteres_id_commit)
Obter o id do commit
Sobrescrever alteraes
locais com ltima verso

git log
git checkout -- <arquivo>

Remover alteraes
e commits locais

git fetch origin


git reset --hard origin/master

Remover arquivo do
index / stage area
Remover arquivo do
repositrio local

git reset <arquivo>


rm <arquivo>

Interface grfica
Sadas coloridas
Log em uma linha
Incluses iterativas

[REMOTO]
Listar todos os remotos
Listar com as urls
Adicionar remoto
Baixar todas as mudanas
no remoto que ainda
no esto no origin
Enviar mudanas
para o remoto
Renomear remoto
_para_o_remoto>
Remover remoto

gitk
git config color.ui true
git config format.pretty oneline
gir add -i

git
git
git
git

remote
remote -v
remote add <nome_para_o_remoto> <url_do_remoto>
fetch <nome_dado_para_o_remoto>

git push <nome_dado_para_o_remoto> <branch>


git remote rename <nome_ANTIGO_do_remoto> <nome_NOVO
git remote rm <nome_dado_para_o_remoto>

Buscar alteraes do servidor principal


git
git
git
git

remote add "tambacode" git@bitbucket.org:tambacode/siteburitech.git


fetch tambacode
pull tambacode master
pull --rebase tambacode master

S-ar putea să vă placă și