2012-07-31 17 views
12

मैं सिर्फ Git-सबट्री उपकरण है जो कुछ समय पहले मुख्य Git रेपो का एक हिस्सा बन https://github.com/apenwarr/git-subtree/क्या

हालांकि मैं पूरी तरह से क्या कार्यक्षमता समझ में नहीं आता पाया है Git सबट्री मर्ज और Git-सबट्री के बीच अंतर है क्या यह टूल पहले से मौजूद "गिट रीड-पेड़" + "गिट मर्ज-एस ​​सबट्री" प्रदान करता है। क्या गिट-सबट्री का एकमात्र purpouse है - परिणामी प्रतिबद्ध इतिहास को बेहतर दिखाना या क्या इसमें अधिक कार्यक्षमता है जिसे मैंने अनदेखा किया है?

उत्तर

12

आपके द्वारा वर्णित आदेश एक सबट्री को एक भंडार में पढ़ते हैं। git-subtree आदेश कई और अधिक विकल्प, के रूप में दूसरों के बीच में the documentation. वर्णन करते हैं, आप (सादगी के लिए एनोटेट) कर सकते हैं:

add:: 
    Create the <prefix> subtree by importing its contents 
    from the given <refspec> or <repository> and remote <refspec>. 
merge:: 
    Merge recent changes up to <commit> into the <prefix> 
    subtree. 
pull:: 
    Exactly like 'merge', but parallels 'git pull' in that 
    it fetches the given commit from the specified remote 
    repository. 
push:: 
    Does a 'split' (see above) using the <prefix> supplied 
    and then does a 'git push' to push the result to the 
    repository and refspec. This can be used to push your 
    subtree to different branches of the remote repository. 
split:: 
    Extract a new, synthetic project history from the 
    history of the <prefix> subtree. The new history 
    includes only the commits (including merges) that 
    affected <prefix>, and each of those commits now has the 
    contents of <prefix> at the root of the project instead 
    of in a subdirectory. Thus, the newly created history 
    is suitable for export as a separate git repository. 

भी झंडे कि सहायता के लिए कई तरह के होते हैं और इसके बाद के संस्करण में हेरफेर। मेरा मानना ​​है कि ये सभी विकल्प प्लंबिंग कमांड की श्रृंखला के माध्यम से पहले उपलब्ध थे। git-subtree.sh बस उन्हें लपेटता है और उन्हें निष्पादित करने में काफी आसान बनाता है।

5

यदि आप पुराने उपट्री कोड को एक contrib मॉड्यूल के रूप में गिट में जोड़ने से पहले देखते हैं: https://github.com/apenwarr/git-subtree/blob/master/git-subtree.sh आप देख सकते हैं कि गिट सबट्री टूल वास्तव में निचले स्तर के गिट सबट्री विलय रणनीतियों के आसपास एक और अधिक उन्नत रैपर है।

यह मूल रूप से उन रणनीतियों को उप-प्रबंधन प्रबंधन को अधिक आसान बनाने के लिए एक समझदार तरीके से लेता है। विशेष रूप से - स्क्वैश सामान वास्तव में वास्तव में उपयोगी है।