What is the difference between:
git checkout -b <branch> origin/<branch>
and
git pull origin <branch>
They seem to have the same functionality to me. thanks.
git pull
contacts the remote repository identified by origin
and looks for updates. It fetches any updates and then merges the changes into the target branch. It does not create a new branch.
git checkout -b <branch> origin/<branch>
creates a new branch based on origin/<branch>
, and does not contact the remote repository. It looks at origin/<branch>
as it currently exists in your local repository.
The two commands perform very different actions; spending some quality time with the git-pull
and git-checkout
man pages might help clarify things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With