TIL - Git: fetch changes from a remote branch to a different local branch
→ Ale Narvaja
Posted on March 11, 2022
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>
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
💖 💪 🙅 🚩
→ Ale Narvaja
Posted on March 11, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
todayilearned How to automatically migrate all your repositories from Gitlab to Github.
February 12, 2023