2013-10-24 4 views
8

मैं अपने मैकवीम स्थापना के लिए एक गिट भंडार बना रहा हूं। मेरे भंडार में कुछ प्लगइन्स के पास अपने स्वयं के .git फ़ोल्डर्स और रेपो हैं। समस्या यह है कि ... जब मैं इन फ़ोल्डर्स में से किसी एक को अपने मुख्य भंडार में जोड़ने का प्रयास करता हूं, तो यह कुछ भी नहीं करता है।गिट मौजूदा गिट रिपोजिटरी के साथ फ़ोल्डर जोड़ें

मेरा अनुमान है:

मैं क्योंकि यह अपने आप पर एक Git रेपो है फ़ोल्डर नहीं जोड़ सकते। मुझे एक सबमिशन के रूप में जोड़ना होगा या .git फ़ोल्डर को हटा देना होगा।

मैं अपने सब रिपोज़ को एक सबमिशन के रूप में कैसे जोड़ूं?

bryan-mini:.vim bsaltzman$ git status 
# On branch master 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# (commit or discard the untracked or modified content in submodules) 
# 
# modified: bundle/YouCompleteMe (modified content) 
# modified: bundle/nerdtree (modified content) 
# modified: bundle/ultisnips (modified content) 
# 
no changes added to commit (use "git add" and/or "git commit -a") 

// This 
bryan-mini:.vim bsaltzman$ git add bundle/YouCompleteMe/ 
// OR THIS 
bryan-mini:.vim bsaltzman$ git submodule add bundle/YouCompleteMe/ 
repo URL: 'bundle/YouCompleteMe/' must be absolute or begin with ./|../ 

bryan-mini:.vim bsaltzman$ git status 
# On branch master 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# (commit or discard the untracked or modified content in submodules) 
# 
# modified: bundle/YouCompleteMe (modified content) 
# modified: bundle/nerdtree (modified content) 
# modified: bundle/ultisnips (modified content) 
# 
no changes added to commit (use "git add" and/or "git commit -a") 

उत्तर

4

ऐसा लगता है कि आपने उन रिपो को सही ढंग से जोड़ा है लेकिन आपने उन रिपो के अंदर एक फ़ाइल को बदल दिया/जोड़ा/हटा दिया है। यदि आप बंडल/nerdtree में सीडी करते हैं और 'गिट स्टेटस' करते हैं तो आपको यह बताना चाहिए कि अलग क्या है। आप submodule एक साफ राज्य उच्च-स्तरीय एक कह रहा बंद कर देना चाहिए में वापस लाने हैं

इसके अलावा "सामग्री संशोधित", अपने आदेश:

git submodule add bundle/YouCompleteMe/ 

सही नहीं है। 'Git submodule जोड़ें' इसलिए की तरह एक रेपो यूआरएल लेता है:

git submodule add https://github.com/Valloric/YouCompleteMe.git 

लेकिन अपने उत्पादन से ऐसा लगता है कि आप पहले से ही कुछ बिंदु पर सही ढंग से किया है कि लग रहा है। आप अपने submodules का प्रबंधन करने के लिए Pathogen का उपयोग कर रहे प्रतीत होते हैं - इसके लिए दस्तावेज़ों को इस प्रक्रिया के माध्यम से आपको अच्छी तरह से चलना चाहिए। या आप वंडल पर स्विच कर सकते हैं जो स्पष्ट रूप से कुछ फायदे हैं (व्यक्तिगत रूप से मैं अभी भी पथजन पर हूं)।

git submodule add (repo url) मूल फ़ोल्डर में: उप-फ़ोल्डर में मौजूदा रेपोस जोड़ने के लिए

0

सही तरह से अमल सरल है।

उदाहरण के लिए:

cd ~/.vim/bundle 
git submodule add https://github.com/Valloric/YouCompleteMe.git 
संबंधित मुद्दे