Today I Learn: Checkout from your remote branch
Well, it’s not a geeky tips but it works
git checkout --track [remote]/[branch]
With this, you don’t have to manually checkout from or to a local branch, then do a git pull ways. The above commands will save us a tremendous time to directly getting our hands dirty and wet.
You might also be wondering didn’t this command has the same purpose with below
git checkout -b [mybranch] [remote]/[branch]
Well, the answer is yes, but the command designed for different cases.
- --track solely to directly match the branch name and HEADs from the remote
- -b [mybranch] same purpose but with little extra feature to customize or rename our branch.
So, which side are you? The dark side or the light side? Choose your side wisely.
Maybe that’s it for now. You might comment below for any other interesting cases also correcting my mistake or giving any feedback in this article.