Anders Lind
Anders Lind

Reputation: 4840

After successful "merge" on Git. I still got weird file

this file is weird. See there are "<<<<<>>>>>" in my file . How can I make it right??

Thank you!

source 'http://rubygems.org'

gem 'rails', '3.2.0'
gem 'bcrypt-ruby', '3.0.1'

group :development do
  gem 'sqlite3', '1.3.5'
  gem 'annotate', '~> 2.4.1.beta'
  gem 'rspec-rails', '2.7.0'
  gem 'guard-rspec', '0.5.5'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
  gem 'uglifier', '1.0.3'
end

gem 'jquery-rails', '1.0.18'

group :test do
  # Pretty printed test output
  gem 'turn', '0.8.2', :require => false
  gem 'rspec-rails', '2.7.0'
  gem 'capybara', '1.1.2'
  gem 'rb-fsevent', '0.4.3.1', :require => false
  gem 'growl', '1.0.3'
  gem 'guard-spork', '0.3.2'
  gem 'spork', '~> 0.9.0.rc'
<<<<<<< HEAD
end

group :production do
  gem 'therubyracer-heroku', '0.8.1.pre3'
  gem 'pg'
end

gem 'pg'
=======
  gem 'factory_girl_rails', '1.4.0'
end
>>>>>>> sign-up

Actually ,I have doen merge successfully.

see:

andy@Macbook-Pro~/Documents/workspace/RoR/app2012$ git me rge sign-up

Already up-to-date.

Edited:

When I do git status, I got this:

# On branch master
# Your branch is ahead of 'heroku/master' by 2 commits.
#

Upvotes: 1

Views: 87

Answers (1)

Daniel Pittman
Daniel Pittman

Reputation: 17212

You didn't have a successful merge, you had a merge with conflicts. Both sides of the merge touched the same code, and git presented it for you to figure out what it should look like.

What you did instead is to commit the bits that show where the conflict was; your best bet is to git reset --hard to the branch before the merge, and then redo it - but actually fix the conflict this time.

http://progit.org/book/ch3-2.html has a section on merge conflicts that should help you out understanding exactly what happened and what to do about it.

Upvotes: 5

Related Questions