First, some general advice that I think you should consider
A good rule of thumb on home buying is to wait to buy until you expect to live in the same place for at least 5 years. This period of time is meant to reduce the impact of closing costs, which can be 1-5% of your total buying & selling price. If you bought and sold in the same year, for example, then you might need to pay over 5% of the value of your home to realtors & lawyers!
This means that for many people, it is unwise to buy a home expecting it to be your 'starter' home, if you already are thinking about what your next (presumably bigger) home will look like. If you buy a townhouse expecting to sell it in 3 years to buy a house, you are partially gambling on the chance that increases in your townhome's value will offset the closing costs & mortgage interest paid. Increases in home value are not a sure thing. In many areas, the total costs of home ownership are about equivalent to the total costs of renting, when you factor in maintenance. I notice you don't even mention renting as an option - make sure you at least consider it, before deciding to buy!
Also, don't buy a house expecting your life situation to 'make up the difference' in your budget. If you're expecting your girlfriend to move in with you in a year, that implies that you aren't living together now, and maybe haven't talked about it. Even if she says now that she would move in within a year, there's no guarantee that things work out that way. Taking on a mortgage is a commitment that you need to take on yourself; no one else will be liable for the payments.
As for whether a townhouse or a detached house helps you meet your needs better, don't get caught up in terminology.
There are few differences between houses & townhomes that are universal. Stereotypically townhomes are cheaper, smaller, noisier, and have condo associations with monthly fees to pay for maintenance on joint property. But that is something that differs on a case-by-case basis. Don't get tricked into buying a 1,100 sq ft house with a restrictive HOA, instead of a 1,400 sq ft free-hold townhouse, just because townhouses have a certain reputation.
The only true difference between a house and a townhouse is that 1 or both of your walls are shared with a neighbor. Everything else is flexible.