Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I think this person should leave it, but clean up the docs leaving the swear only visible when strictly necessary. A good strategy is to list the repo under an appropriate name "Chef Cyanide's BF shell", then when you are discussing with technical interviewers, you can mention the repository and note that it's probably the best showcase of your capabilities. You don't have to swear, you can talk about it intelligently. They may or may not ask to see it. People browsing you git* without you mentioning it will either be switched on enough to investigate, or just pass it by.
This sounds like a case of poor management on the part of your friend. Building upon what @abl commented above, it sounds like this particular hire has been set up for failure since the beginning. We need to know how working remotely/in office sometimes is a negative attribute. Nebulous concepts such as "poor attitude" and "communication skills" are hardly concrete enough to form an opinion. Are messages expected to be responded to within a certain time frame? Perhaps they like to focus on tasks and respond later. Everything here points to poor management.
It's also important to document that this is typical behaviour for staff, and that it has not be met out with punishment. Established behaviourial norms within a company can't be used to selectively terminate people whenever they decide it is convenient. Right to work states might mess with that, however, they could have a case and should speak with a lawyer if they are terminated.