मैं के लिए यह किया Github जो hesco/hesco-weave कहा जाता है के रूप में इस पर एक नमूना परियोजना:
मैं कर्ल इस्तेमाल किया, jq, कट और पूंछ निम्न उदाहरण में आदेश, ताकि आप उन्हें उदाहरण चलाने से पहले की आवश्यकता है।
पहले, परियोजना के दो पिछले टैग पाए जाते हैं:
[email protected]: ~ $ curl -s https://api.github.com/repos/hesco/hesco-weave/git/refs/tags | jq -r ".[].ref" | cut -d "/" -f 3
v0.1
v0.2
v0.3
v0.4
v0.5
v0.6
v0.7
v0.8
v0.8.6
v0.8.7
[email protected]: ~ $ curl -s https://api.github.com/repos/hesco/hesco-weave/git/refs/tags | jq -r ".[].ref" | cut -d "/" -f 3 | tail -n 3
v0.8.6
v0.8.7
या आप परियोजना का एक checkouted संस्करण है यदि:
[email protected]: ~/github/hesco-weave (master) $ git remote -v
origin https://github.com/hesco/hesco-weave.git (fetch)
origin https://github.com/hesco/hesco-weave.git (push)
[email protected]: ~/github/hesco-weave (master) $ git tag -l
v0.1
v0.2
v0.3
v0.4
v0.5
v0.6
v0.7
v0.8
v0.8.6
v0.8.7
[email protected]: ~/github/hesco-weave (master) $ git tag -l | tail -n 2
v0.8.6
v0.8.7
refs की शा इस प्रकार हैं :
[email protected]: ~ $ git ls-remote | tail -n 2
be74d8368acd4815b6863daded46a232944e0d84 refs/tags/v0.8.6
9181306caa304b4cf8b3764b1446c0c4006833d8 refs/tags/v0.8.7
दूसरा, एक Git भंडार बनाई गई है:
[email protected]: ~/test (master) $ git subtree add --squash --prefix=weave https://github.com/hesco/hesco-weave.git v0.8.6
git fetch https://github.com/hesco/hesco-weave.git v0.8.6
warning: no common commits
remote: Counting objects: 543, done.
remote: Compressing objects: 100% (193/193), done.
remote: Total 543 (delta 306), reused 536 (delta 306), pack-reused 0
Receiving objects: 100% (543/543), 93.19 KiB | 0 bytes/s, done.
Resolving deltas: 100% (306/306), done.
From https://github.com/hesco/hesco-weave
* tag v0.8.6 -> FETCH_HEAD
Added dir 'weave'
ट्रेस जानकारी:
[email protected]: ~ $ mkdir -p ~/test
[email protected]: ~ $ cd ~/test
[email protected]: ~/test $ git init
Initialized empty Git repository in ~/test/.git/
[email protected]: ~/test $ touch README.md
[email protected]: ~/test $ git add .
[email protected]: ~/test $ git commit -m "README.md added"
[master (root-commit) b1ac90e] README.md added
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
[email protected]: ~/test (master) $ git log
commit 19c0570a414c4fd1635444b7a937dfc41c93a847
Author: Me <[email protected]>
Date: Wed Jun 14 13:02:05 2017 +0200
README.md added
तीसरा, Github के भंडार का v0.8.6 टैग सबट्री के रूप में बनाया भंडार में जोड़ा जाता है
[email protected]: ~/test (master) $ git log
commit e5dc318c4437cd22ebddb9e82e8c419aef72a781
Merge: b1ac90e 19c0570
Author: me <[email protected]>
Date: Wed Jun 14 13:02:25 2017 +0200
Merge commit '19c0570a414c4fd1635444b7a937dfc41c93a847' as 'weave'
commit 19c0570a414c4fd1635444b7a937dfc41c93a847
Author: me <[email protected]>
Date: Wed Jun 14 13:02:25 2017 +0200
Squashed 'weave/' content from commit be74d83
git-subtree-dir: weave
git-subtree-split: be74d8368acd4815b6863daded46a232944e0d84
commit b1ac90efbfe5978bac52984c29e6ec7904ed9a75
Author: me <[email protected]>
Date: Wed Jun 14 13:02:05 2017 +0200
README.md added
अंत में, नए टैग v0.8 के साथ बुनाई subtree।7 git subtree pull
साथ विलय कर दिया गया है:
[email protected]: ~/test (master) $ git subtree pull --squash --prefix=weave https://github.com/hesco/hesco-weave.git v0.8.7
warning: no common commits
remote: Counting objects: 548, done.
remote: Compressing objects: 100% (195/195), done.
remote: Total 548 (delta 311), reused 541 (delta 309), pack-reused 0
Receiving objects: 100% (548/548), 90.50 KiB | 0 bytes/s, done.
Resolving deltas: 100% (311/311), done.
From https://github.com/hesco/hesco-weave
* tag v0.8.7 -> FETCH_HEAD
Merge made by the 'recursive' strategy.
weave/Changelog | 1 +
weave/Modulefile | 2 +-
weave/README.md | 2 +-
weave/metadata.json | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
ट्रेस जानकारी:
[email protected]: ~/test (master) $ git log
commit 9116e133c8d84de1df9883a8b5558a2350ebc86e
Merge: e5dc318 eb2e273
Author: me <[email protected]>
Date: Wed Jun 14 13:03:16 2017 +0200
Merge commit 'eb2e2733a75d59eb1adebf4755d5b11cb74e2b98'
commit eb2e2733a75d59eb1adebf4755d5b11cb74e2b98
Author: me <[email protected]>
Date: Wed Jun 14 13:03:16 2017 +0200
Squashed 'weave/' changes from be74d83..9181306
9181306 make release used to update version to v0.8.7
3871cf5 Update changelog, tag v0.8.6, fix link in README
REVERT: be74d83 Update changelog, tag v0.8.6, fix link in README
git-subtree-dir: weave
git-subtree-split: 9181306caa304b4cf8b3764b1446c0c4006833d8
commit e5dc318c4437cd22ebddb9e82e8c419aef72a781
Merge: b1ac90e 19c0570
Author: me <[email protected]>
Date: Wed Jun 14 13:02:25 2017 +0200
Merge commit '19c0570a414c4fd1635444b7a937dfc41c93a847' as 'weave'
commit 19c0570a414c4fd1635444b7a937dfc41c93a847
Author: me <[email protected]>
Date: Wed Jun 14 13:02:25 2017 +0200
Squashed 'weave/' content from commit be74d83
git-subtree-dir: weave
git-subtree-split: be74d8368acd4815b6863daded46a232944e0d84
commit b1ac90efbfe5978bac52984c29e6ec7904ed9a75
Author: me <[email protected]>
Date: Wed Jun 14 13:02:05 2017 +0200
README.md added
[email protected]: ~/test (master) $ ll
total 4
-rw-rw-r-- 1 me me 0 Jun 14 13:01 README.md
drwxrwxr-x 8 me me 4096 Jun 14 13:03 weave
मैं Bproject/मास्टर प्रदान नहीं करते हैं, कैसे Git पता है जो दूरदराज के मैं के साथ विलय कर रहा हूँ? – cmaughan
@cmaughan गिट नहीं जानता है। यह सब जानता है कि शा और प्रत्येक शा (टैग, या बीप्रोजेक्ट/मास्टर द्वारा भी प्रतिनिधित्व) कुछ प्रतिबद्धताओं का संदर्भ लेते हैं, जिनमें माता-पिता हैं, और इसी तरह। यही कारण है कि आप रिमोट रिपोजिटरी से 'गिट रिमोट' में' -फ' विकल्प) लाते हैं - आपको सभी काम और उसके शा मिलते हैं। और फिर आप अपने पेड़ पर कुछ पेड़ (रिमोट, निश्चित रूप से शा द्वारा) मर्ज करें। उम्मीद है कि यह कैसे काम करता है – MBO
ठीक है - मेरे लिए अच्छा लगता है! टकराव टैग चीज कुछ है जो मैं सोच रहा हूं - अगर मेरे पास एक ऐप पर टैग - v1.5 है, और रिमोट v1.5 टैग के रूप में है, तो गिट इसे कैसे हल करता है? किसी भी तरह से, ऐसा लगता है कि मैं जिस समाधान की तलाश में था ... – cmaughan