Update the local list of remote branches in GitHub?

Answered
yaboy01 asked this question 11 months ago
yaboy01 on Mar 3, 2022

When I run the git branch -a command on my machine, it lists all the branches in the local version of my repository.

But, this doesn't match what's in the remote repository.

How can I have the branches in my local repository match what's in the remote repository?

3 suggested answers
coderguy on Mar 27, 2022

You can use fetch:

git fetch origin

When that's done, you can list all the local branches:

git branch -a

You should see all the remote branches listed in the output.

0 replies
timmy123 on Mar 27, 2022

This fetches all remote branches:

git fetch --all

And this updates all the remote branches on your local machine:

git pull --all
0 replies
rusty1_rusty1 on Mar 27, 2022

Update information about the remote branches on your local computer:

git fetch --all

Update information about the remote branches on your local computer and update local branches:

git pull --all
0 replies
Answered