2013-11-27 50 views
1

我對解決合併衝突相當陌生。 在這種情況下應該怎麼做?現有的代碼是否被刪除,新的(和非常不同的)代碼取代了它?我只是刪除HEAD和========之間的代碼?或者這是否意味着HEAD具有我需要的新描述塊(pool_availability_bv_callback)以及我的代碼中的新描述「#moved」塊?如何解決這個混帳合併衝突?

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 
+0

爲什麼這個標籤爲Ruby?因爲這是什麼文字? –

+0

我刪除了標籤 –

回答

2

基本上就意味着HEAD=======之間的塊比的=======>>>>>> origin/one-169之間有什麼顯着不同。您將刪除HEAD,=======>>>>>>> origin/one-169行,並刪除/移動任何剩餘的代碼。

發生這種情況是因爲回購的提示(或HEAD)與您的分支(one-169)不同,git無法簡單地自動合併此分支。 Git依靠你來告訴它這兩種選擇之間應該包含哪些內容,包括保持這兩種選擇。

一旦這個文件是應該的方式,你會做git add <file>然後git commit完成合並。

+0

是的。基本上這兩個區域的代碼都需要保留,所以需要顯示所有代碼行,再加上一些額外的末端來完成第一個塊。 –