In Git bash , to update the current local branch from a remote branch , we use the command:
git pull nomeDoRemote nomeDoBranch
Still in bash , when navigating to a project directory, we see something like this:
usuario MINGW64 ~/foo/bar (nomeDoBranch)
That way, it's easy to know the name of a branch to update it – with the assumption that it was created from a remote, or that it is at least published.
But how can we get the name of the remote(s) associated with the project?
git remote -v command, you will see the remote repositories configured in your local project:
marcelo@marcelo-X555LF:/var/www/html/projeto$ git remote -v origin https://firstname.lastname@example.org/repositorio/projeto.git (fetch) origin https://email@example.com/repositorio/projeto.git (push)
git ls-remote you will see the remote repositories associated with the commits:
From https://firstname.lastname@example.org/repositorio/projeto.git xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HEAD xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/dev xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/feature#10915 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/feature#12617 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/feature#14391 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/master