Ramos Git

Crie um novo repositório git (se ainda não tiver um)

$ git init

Verifique as filiais existentes

$ git branch
=> *master

Crie e mude para um novo braço

$ git checkout -b newbranch

Você criou e mudou para a filial newbranch .

Vamos brincar um pouco, criar um novo arquivo neste branch (unix):

$ touch file.txt

Adicione o arquivo.txt ao git

$ git add .

Comprometa suas mudanças

$ git commit -m "file.txt added"

Voltando ao ramo mestre

$ git checkout master

Observe que o arquivo.txt não existe no branch master . Você precisa mesclar o novo ramo com o ramo mestre para manter tudo atualizado.

$ git merge newbranch

Agora seu braço mestre tem acesso a arquivo.txt . Verifique seus registros.

$ git log

Feliz Hacking!