I'm a git newbie, and just started using it the other day. The idea seems good, but I've already run into a problem that makes git seem like much more of a hassle than it's worth.
What I'm doing:
I started by adding it to one of my projects, and I created 3 branches:
- Master
- Stable
- Alpha
All seemed fine. As of today, Master and Stable were pretty much the same code. I was working on Alpha, which contained the beginnings of some new features.
What went wrong:
I wanted to finish bug testing the stable branch, so I can release an update to an iOS app. I changed to the master branch accidentally (this is the branch that I plan to use for released versions) and then wanted to change to the stable branch. However, on attempting to change I receive the error:
"you need to resolve your current index first"
And the branch refuses to change. Apparently, it's something to do with a bad merge... although I can't even remember merging anything, except for maybe a few lines of code when I was setting up git. Here's the output of 'git status':
# On branch master
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: Schedule.xcodeproj/project.xcworkspace/xcuserdata/Jordan.xcuserdatad/UserInterfaceState.xcuserstate
#
I'm using Xcode 4, and using the built in repository manager to switch branches/manage git etc.
So, what went wrong? Why is git giving me errors, even though I never really merged much (or anything?) in the first place - and how can I fix it, and avoid it happening in the future?