Having trouble with my girlfriend's cat constantly hissing at me and swiping at my legs. Wondering if there is a way I can get this cat to like me, or at least to get it to stop this behavior.
The cat is a 4 year old female. It is very affectionate to my girlfriend although this is much more muted when I or any other company is around. The problem is my girlfriend lives in a smallish apartment, so there are times where I have to walk by the cat to get to something and about 80% of the time it will hiss, and maybe 40-50% of the time will claw my legs as I walk by.
At the moment I am currently watching this cat at my apartment for the rest of the month where the problem is more acute, as there are thin hallways you need to traverse to get anywhere, and it seems more on edge than usual, given it hasn't seen my girlfriend in quite a few days.
There have also been a few occasions at my girlfriend's apartment where it went out of its way to walk over and swipe me.
I understand this is likely a fear reaction, so what can I do to stop it? It seems to have stopped giving me the mean glare in recent days and it is generally receptive when I play with it using its wand toy. I also try to give it a treat once a day when I walk in the door.
If getting this cat to like me is improbable, is there any other way I can get it to stop swiping at me at least? The cat seems to have an expansive definition of "personal space", so just avoiding it all the time isn't really an option.
Edit: Adding additional info from my comments below!
Neither my girlfriend nor I knew what to do at first so there was poor behavior in the past, i.e., I would pet her when she was being affectionate to my girlfriend, which the cat didn't like, and I would stare back at her instead of averting my gaze. Now I don't touch the cat with the exception of it eating treats out of my hand, which I give to her once a day at some point after walking in the door. We no longer have staring contests. When she swipes at me I just continue walking past the cat as if it didn't happen.
Also realizing I forgot to include that my girlfriend has a second cat that I am watching as well. The second cat is fine and has actually been pretty affectionate to me in my girlfriend's absence. The two cats don't interact very often but the mean one will hiss at the affectionate one as well sometimes. The affectionate will also occasionally play fight with the mean one, although I don't think the mean one takes it as playing. (This happens maybe less than once a day on average from what I can tell.)