I often need to checkout latest version of another branch:
git checkout anotherbranch
git pull
How can I do that without checking out outdated version of anotherbranch first?
e.g.:
GIVEN
- There are branches master and feature1
- each branch has one remote called origin and equally named remote branch.
- there are no local unpushed commits
WHEN:
- I'm on feature1, and somebody merged PR into master
THEN:
How do I checkout latest version of master?
Does following the trick?
git fetch origin master
git checkout master