I have created a new branch and added some files.
Locally I use tortoise GIT and when I switch to the new branch, the files are updated.
On my production server using CLI, when I switch to the new branch with git checkout mynewbranch
, the files are not updated.
When I switch with git checkout origin/mynewbranch
, the files are updated but i get the following message:
You are in 'detached HEAD' state. You can look around, make
experimental changes and commit them, and you can discard any commits
you make in this state without impacting any branches by performing
another checkout.
Why is this?
It appears as if you already have a local branch with the name mynewbranch
but this branch does not have the recent changes that you're looking for. Those changes do exist in the origin, however. Because of this, when you git checkout origin/mynewbranch
you are able to see the changes. If you want to pull these changes into your local mynewbranch
branch, issue the following commands:
git checkout mynewbranch
git pull . origin/mynewbranch
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