Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Merging Merge Conflicts

Could not get Master branch and foo-feature branch to auto-merge in previous video. Now serious problems. D:

I couldn't get the master branch and the auto-merge branch to merge in the previous video "Basic Merging". I thought this made sense, because the README file I created was something completely random (e.g. "asdfgas"). I'm trying to follow this tutorial, "Merge Conflicts", but encountered many a problem.

I typed in git checkout foo_feature, to switch to the foo_feature branch.

I got an error message

README: needs merge error: You need to resolve your current index first.

I tried deleting the README file within foo_feature, I tried deleting the foo_feature branch. I tried to delete the README file within the master branch. I think that's just screwed things up eeeeven more.

So right now my console looks like this.

treehouse ~/my_really_cool_project $ git checkout master README: needs merge error: You need to resolve your current index first treehouse ~/my_really_cool_project $

...

Halp ;_;

How do I resolve my current index?

Um ok in the addition to the above I think I've screwed it up even further.

I looked up on google how to fix a conflict like this, and there was a forum in which someone said use the 'merge tool'

Long story short now my screen looks like this

treehouse ~/my_really_cool_project $ls file 1 README.BACKUP.1872 README.LOCAL.1238 README.REMOTE.1238 file 2 README.BASE.1238 README.LOCAL.1451 README.REMOTE.1451 file 3. README.BASE.1451 ...............

And it goes on. Same error message when I try to checkout the master branch.

Is there anyway to reset the console so I'm up to speed with the tutorial videos? Cuz I think I just broke the computer. O_O

1 Answer

Woah! I mean you could always delete you project and download the project files (check they're available first) if you wanted to start again.

I think you're hitting your current problem because you haven't resolved conflicts. Git will try and stop you from doing anything until you've fixed your merge.

what does git tell you when you run 'git status'

If I had watched the rest of the video I would have been able to resolve to original conflict with ease. Oh dear. :P

But thanks anyway. I will probably have to get around to installing git on my Windows machine (I was using the remote Linux computer offered by Treehouse), and I'll probably re-do this section at some point.

There was only one or two tutorials after this one, so I just watched closely and made notes.