-
-
Save locopine/62ca53bd4a23d86b74b8cfa4571ca5e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Para um novo projeto, crie esta estrutura | |
[dev-user1] $ mkdir projeto | |
[dev-user1] $ cd projeto | |
[dev-user1] $ git init | |
[dev-user1] $ touch README | |
[dev-user1] $ git add . | |
[dev-user1] $ git commit -am "Initial commit" | |
# Crie no servidor um repositório do tipo bare para "guardar" os commits | |
[bare-server1] $ mkdir -p /git/projeto | |
[bare-server1] $ cd /git/projeto | |
[bare-server1] $ git --bare init | |
# Adicione o repositório bare como 'origin' | |
[dev-user1] $ git remote add origin ssh://user1@server1/git/projeto | |
# Envie seus commits para o 'origin' | |
[dev-user1] $ git push origin master | |
# Outro desenvolvedor vai trabalhar neste projeto | |
[dev-user2] $ git clone ssh://user2@server1/git/projeto | |
[dev-user2] $ cd projeto | |
[dev-user2] $ touch TESTFILE | |
[dev-user2] $ git add TESTFILE | |
[dev-user2] $ git commit -am "Test commit" | |
[dev-user2] $ git push origin master | |
# Depois de configurado, os dois usuários já podem baixar commits quanto existirem | |
[dev-user1] $ git pull origin master | |
[dev-user2] $ git pull origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment