DEV Community

→ Ale Narvaja
→ Ale Narvaja

Posted on

2 1

TIL - Git: fetch changes from a remote branch to a different local branch

Today I learned that if I want to fetch changes from a remote branch to a different local branch, all I have to do is:

git checkout <local-branch>
git pull origin <remote-branch>
Enter fullscreen mode Exit fullscreen mode

For example, if I would like to fetch changes from master to a test branch:

git checkout test // we move to test branch
git pull origin master // we pull data from master to test
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay