पृष्ठभूमि
लिनक्स पर Git 1.8.1.1 का उपयोग करना। रिपॉजिटरी इस प्रकार दिखता है:
master
book
निम्न प्रकार बनाया गया था:
$ cd /path/to/master
$ git submodule add https://user@bitbucket.org/user/repo.git book
bookSubmodule साफ है:
$ cd /path/to/master/book/
$ git status
# On branch master
nothing to commit, working directory clean
मुसीबत
दूसरी ओर, मास्टर दिखाता है कि पुस्तक के लिए "नए तरीके" हैं:
$ cd /path/to/master/
$ 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)
#
# modified: book (new commits)
#
no changes added to commit (use "git add" and/or "git commit -a")
Git को सबमॉड्यूल निर्देशिका को पूरी तरह से अनदेखा करना चाहिए, ताकि मास्टर भी साफ हो:
$ cd /path/to/master/
$ git status
# On branch master
nothing to commit, working directory clean
विफल # 1 - गंदा
फ़ाइल के अंदर master/.gitmodulesइस उत्तर के अनुसार निम्नलिखित है :
[submodule "book"]
path = book
url = https://user@bitbucket.org/user/repo.git
ignore = dirty
विफल # 2 विफल - विफल
master/.gitmodulesइस उत्तर के अनुसार निम्नलिखित में परिवर्तन किया गया है :
[submodule "book"]
path = book
url = https://user@bitbucket.org/user/repo.git
ignore = untracked
असफल # 3 - showUntrackedFiles
master/.git/configइस उत्तर के अनुसार निम्नलिखित को संपादित किया गया :
[status]
showUntrackedFiles = no
असफल # 4 - नजरअंदाज
मास्टर अनदेखा फ़ाइल में पुस्तक निर्देशिका जोड़ी:
$ cd /path/to/master/
$ echo book > .gitignore
विफल # 5 - क्लोन
पुस्तक निर्देशिका को गुरु के साथ इस प्रकार जोड़ा गया:
$ cd /path/to/master/
$ rm -rf book
$ git clone https://user@bitbucket.org/user/repo.git book
सवाल
bookसबमॉडल अपने ही रिपोजिटरी डायरेक्टरी में कैसे हो सकता है रिपॉजिटरी के तहत masterअभी तक सबमॉडल को नजरअंदाज नहीं किया है book? यही है, निम्नलिखित को प्रदर्शित नहीं करना चाहिए:
#
# modified: book (new commits)
#
git statusमास्टर रिपॉजिटरी में निष्पादित करते समय उस संदेश को कैसे दबाएं?
गिट सबमॉडल नुकसान के बारे में एक लेख यह एक अनुचित सबमॉड्यूल उपयोग का सुझाव देता है?