It must use the following command if it does not have the branch on the local machine:
git checkout --track -b <apelido_do_branch_local> <apelido_do_repositório_remoto>/<apelido_do_branch_remoto>
The flag --track
connects the local repository with the remote and flag -b
warns git that a new branch should be generated because the command checkout
has other functions.
This command will create a new branch
same location as remote with nickname <apelido_do_branch_local>
Example: My remote repository on Github is https://github.com/luizfilipe/repositorio
in my local repository it is mapped to the nickname origin
, I want to bring the new nickname created branch branch1
.
The command to be executed will be:
git checkout --track -b branch1local origin/branch1
If it already has the local branch it should use:
git pull <apelido_do_repositório_remoto> <apelido_do_branch_local>
example: my remote repository on Github is: https://github.com/luizfilipe/repositorio
in my local repository it is mapped to the nickname origin
, I want to bring up the nickname branch update branch1
, within the branch1local
I use the command:
git pull origin branch1
Layman’s question: how do I find out the [remote-name]?
– morphinduction