Wikipedia:Git
Google
http://stackoverflow.com/questions/19021978/git-how-to-block-push-to-master-branch-on-remote
http://dev.ghost.org/prevent-master-push/
#!/bin/bash protected_branch='master' current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') if [ $protected_branch = $current_branch ] then read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty echo if echo $REPLY | grep -E '^[Yy]$' > /dev/null then exit 0 # push will execute fi exit 1 # push will not execute else exit 0 # push will execute fi
chmod +x pre-push
git clone ssh://<usuario>@<servidor>:<diretorio>/<projeto.git> <nome_do_clone>
ou
git clone ssh://<usuario>@<servidor>:<diretorio>/<projeto.git>
git clone -b <branch> <remote_repo>
git commit -a -m “texto/descrição do commit”
git commit -m “texto/descrição do commit”
git add diretório/nome_do_arquivo
Lista todos os branch's e mostra em qual branch você está atualmente
git branch
Cria um novo branch e faz checkout automaticamente para este novo branch
git branch <nome-branch>
git push -u origin <nome-branch>
Para apagar um branch você tem que sair dele fazer checkout em outro branch para poder apagar ele
git branch -d <nome-branch>
git checkout <branch/master>
Publica no repositório remoto
git push origin <master/branch>
Pega modificações existentes no repositório <master/branch>
git pull
Faz a união de <branch/master> ou <master/branch>
git merge <branch/master>
git diff
git status
git log
git reset <diretório/arquivo>
git checkout <diretório/arquivo>