I have done the following command
git checkout -b mylocalbranch origin/develop
I know that mylocalbranch does not have the latest commits on develop. After
git pull --ff-only
it appears I have all the commits. So am correct about this and if so, what commits are reflected in mylocalbranch after the checkout but before the pull?
git checkout
does not interact with any remotes, it only operates within your local repository. This means that your command will create a new branch ( mylocalbranch
) and sets it to point to wherever your local remote tracking branch origin/develop
is currently pointing to. When you do a git pull
or git fetch
, the remote tracking branches are updated.
The subsequent pull was in your case needed because since the last time you pulled or fetched, new commits had appeared on the remote's develop
branch.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.