Zu machen, wie die äußeren repository und embedded-repository arbeiten als common/standalone-repository?

Ich habe ein großes Projekt(sagen wir mal A repo), und es gibt eine untergeordnete Ordner-die kommen aus B repo. Ich würde das treffen Warnung wie unten, wenn ich das Begehen von A repo

warning: adding embedded git repository: extractor/annotator-server
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint:   git submodule add <url> extractor/annotator-server
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint:   git rm --cached extractor/annotator-server
hint:
hint: See "git help submodule" for more information.

Habe ich gesehen git-submodule und git-subtree:

Die Aufrechterhaltung Git-repo in ein anderes git-repo

https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree

Aber ich mag Sie nicht , denn Sie brauchen die extra config.


Was ich will, ist , zum Beispiel:

Struktur wie:

A/
--- a.py

--- B/
--- B/b.py

Wenn ich B/b.py .

  1. Wenn ich mich auf den Weg A/ , git add erkennen kann B/b.py geändert git push nur Begehen, die zu Einem repo.
    git add .   (would add changes under A/ )
    git push   (would push changes under A/ )
    git pull   (would pull changes under A/ )
    git clone XXX:A  (would clone all files under A/,    A/B/is just looks like plain folder with all files, not a repo )
    
  2. Wenn ich mich auf den Weg A/B/ , git add nur hinzufügen B/b.py änderungen an B-repo-und git push nur Begehen, die zu B-repo.
    git add .   (would add changes under B/, but not add changes to A repo)
    git push   (would push changes under B/, but not push changes to A repo)
    git pull   (would clone changes under B/,  )
    git clone XXX:B  (would clone all files under B/ )
    
  3. Einmal möchte ich snyc A und B in einem anderen Rechner, nur
    git clone A
    rm -rf A/B/
    git clone B ./B
    git add . && git commit 'sync with B'
    

In einem anderen word -, A-und B-act als standalone-repo.

Aber die Wahrheit ist , die repo-Behandlung von B-Repository als Submodul:

Repo
https://github.com/eromoe/test

B-repo
https://github.com/eromoe/test2


Wie kann ich die Kraft Eines repo-Spur alle Dateien unter A/ - und B-repo-Spur alle Dateien unter A/B/ ? Ich will A und B handeln als selbst-repo enthalten , ohne irgendeine andere config.

Unmöglich mit Git. Verwenden Sie SVN statt. Vielleicht SVN nicht erfüllen können Ihre Bedürfnisse.
Ich will einfach nur sparen Sie ganze sub .git-Struktur, um ein git-repository... warum ist es nicht möglich. Teilmodule nicht speichern Sie Ihre Filialen oder ungebunden-Dateien.

InformationsquelleAutor Mithril | 2017-10-30

Schreibe einen Kommentar