It can be sensible to tell your GP that you are HIV positive because, when treating you or prescribing medicines, they need to know about other health issues and medicines you take. Doctors cannot refuse to treat you because you have HIV.
Doctors cannot talk about your health with your family, friends or anyone else or show them your medical records; however sometimes they may need to disclose your HIV status. Medical information is usually shared within the healthcare team. But you can ask your doctor not to do this and, unless it would put another worker in danger, the doctor must respect your wishes.
A doctor may have to reveal medical information about you if forced to by a court or requested by the police, or if they think somebody's life is at risk. This is very rare. Your doctor will probably note your HIV status in your medical records.