I have a directory containing some files. I initialized it as a git repository using
git init
I added the current files and committed them to empty repository using
git add .
git commit -m <Message>
Now i added the remote named origin
git remote add origin <remote url>
At this point, i remembered that my remote repository already had some code and hence it would have been better to merge them. So i checked out another branch with current code as
git checkout development
Now i intended to pull remote code in my master and then merge development branch (containing local code) into the master. However when i tried doing
git checkout origin/master
in my master branch then i got a message that HEAD is detached. I am not sure how did this happen.
It would be great if someone could explain why did this happen.
Any help is appreciated. Thanks.