Skip to content

Instantly share code, notes, and snippets.

@interaminense
Last active July 2, 2017 04:01
Show Gist options
  • Save interaminense/95d5e269f41c8b8a18a451567fd03a2b to your computer and use it in GitHub Desktop.
Save interaminense/95d5e269f41c8b8a18a451567fd03a2b to your computer and use it in GitHub Desktop.
Baixar branch do Fork original via git
Precisamos baixar mais uma branch do Fork original. Como fazemos?
1. Utilizamos da seguite linha de comando:
git remote add upstream htttps://github.com/USERNAME/PROJECT_NAME.git
2. O comando "--all" baixa tudo que tem no projeto e "--prune" faz uma limpeza
local em alguma referência e algum arquivo que existia e que hoje não existe mais
git fetch --all --prune
3. lista todas as branchs remotas
git branch -a
4. migra para a branch desejada
git checkout upstream/BRANCH_NAME
5. cria a branch válida, pois a branch atual é ainda uma branch intermediária. É recomendado fazer isto.
git checkout -b BRANCH_NAME
6. levando o commit para o repositório
git push --set-upstream origin BRANCH_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment