2011-06-22 17 views
25

मेरे पास 10 फाइलें हैं जिनमें शाखाएं विलय करते समय संघर्ष होते हैं। मैंने 10 फाइलों के सभी संघर्षों को हल किया है (लंबे समय तक लिया)। दुर्भाग्य से प्रतिबद्ध होने से पहले, मुझे पता चला कि एक फ़ाइल गलत हो गई है और इस फ़ाइल के लिए फिर से शुरू करने की आवश्यकता है। :(गिट में फ़ाइल को फिर से मर्ज कैसे करें?

Git में

, करने के लिए फ़ाइल, कैसे जो मर्ज ना किए गए विलय कर दिया गया, दूसरे शब्दों में चिह्नित करने के लिए कैसे फिर से विलय कि एक फाइल?

+0

के संभावित डुप्लिकेट (http [सिर्फ एक एकल फाइल के विलय फिर से करें]। com/प्रश्न/6857082/redo-merge-of-just-a-single-file) –

उत्तर

29
git checkout -m <filename> 

इस सूची से हटा देगा, और एक "विरोध हुआ" फाइल तो किसी मर्ज करने के लिए आवश्यक मार्कर के सभी है कि के लिए वापस लौटने

Git मदद चेकआउट आदमी पृष्ठ से:।

-m, --merge 
    When switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch 
    branches in order to preserve your modifications in context. However, with this option, a three-way merge between the current branch, your working tree contents, and the new branch is done, and you 
    will be on the new branch. 

    When a merge conflict happens, the index entries for conflicting paths are left unmerged, and you need to resolve the conflicts and mark the resolved paths with git add (or git rm if the merge should 
    result in deletion of the path). 

    When checking out paths from the index, this option lets you recreate the conflicted merge in the specified paths. 

(अंतिम वाक्य सबसे महत्वपूर्ण है) ।

यहाँ एक ब्लॉग पोस्ट का वर्णन करता है कि क्यों यह जोड़ दिया गया है और यह कैसे Git के पुराने संस्करणों के साथ संभव नहीं है: // stackoverflow: http://gitster.livejournal.com/43665.html

+0

धन्यवाद आदमी, यह काम करता है :) – Nyambaa

+0

+1 मीठे! उस अंतिम चीज़ के बारे में नहीं पता था -एम। वास्तव में बहुत उपयोगी! – ralphtheninja

+0

@ मैग्नस स्कोग: मैंने इसे एक या दो बार इस्तेमाल किया है, इसलिए मुझे इसे फिर से ढूंढने के लिए मैन पेजों के माध्यम से खुदाई करना पड़ा। –

संबंधित मुद्दे