如何解决此git合并冲突?
我对解决合并冲突相当陌生。 在这种情况下我该怎么办?现有的代码是否被删除,而新的(而且非常不同的)代码是否替换了它?我是否只删除HEAD和==============之间的代码?或者这是否意味着HEAD有一个新的descripe块(pool_availability_bv_callback),我需要它与代码中的新descripe“#moved”块一起使用如何解决此git合并冲突?,git,rspec,git-merge,Git,Rspec,Git Merge,我对解决合并冲突相当陌生。 在这种情况下我该怎么办?现有的代码是否被删除,而新的(而且非常不同的)代码是否替换了它?我是否只删除HEAD和==============之间的代码?或者这是否意味着HEAD有一个新的descripe块(pool_availability_bv_callback),我需要它与代码中的新descripe“#moved”块一起使用 2315 <<<<<<< HEAD 2316 describe 'pool_availabili
2315 <<<<<<< HEAD
2316 describe 'pool_availability_bv_callback' do
2317 it 'should be invoked during reservation creation' do
2318 PoolAvailabilityBv.should_receive(:calculate_for).once
2319
2320 res = build(:reservation)
2321 res.save!
2322 end
2323
2324 it 'should be invoked during reservation edit' do
2325 res = create(:reservation)
2326
2327 PoolAvailabilityBv.should_receive(:calculate_for).once
2328 reservation.cancel_date = Time.zone.now
2329 res.save!
2330 =======
2331 describe "#moved" do
2332 let!(:vehicle) { create(:vehicle, :in_pool, :with_vehicle_type) }
2333 let!(:reservation) { create(:reservation, pool: vehicle.pool) }
2334
2335 it "should return true if the reservation's vehicle have been moved out if its pool" do
2336 VehiclePoolMap.delete_all # remove all vehicles from pools
2337 expect(reservation.moved?).to be_true
2338 end
2339
2340 it "should return false if the reservation's vehicle has not been moved out if its pool" do
2341 expect(reservation.moved?).to be_false
2342 >>>>>>> origin/one-169
2315>原点/one-169
基本上,这意味着头部和===
之间的块与===
和>>>origin/one-169
之间的块有很大的不同。您将删除头
、====
和>>>>>>>>>>>原点/one-169
行,并删除/移动所需的任何剩余代码
发生这种情况的原因是,回购协议的顶端(或头部
)与分支机构(one-169
)的不同之处使得git无法简单地自动合并。Git依赖于您告诉它这两个选项之间应该有什么,包括保留两者或两者都不保留
一旦这个文件是它应该的样子,你就要做git add
然后git commit
来完成合并。为什么要用Ruby标记这个文件?因为这就是文本?是的。基本上,两个区域的代码都需要保留,因此需要显示所有代码行,再加上两个额外的端点来完成第一个块。