Mohannd के जवाब एकदम सही है, लेकिन मैं पूर्ण समाधान योग करने के लिए, इस मामले में किसी और कुछ की जरूरत है यह चाहते हैं:
एक OpenShift रेपो के रूप में अपने GitHub रेपो उपयोग करने के लिए, वहाँ कोई सही समाधान अब है, क्योंकि, Openshfit आपके काम के आधार पर तैनाती या पुनर्निर्माण को ट्रिगर करने के लिए गिट हुक का उपयोग करता है। हालांकि, सबसे स्मार्ट तरीका कोड को एक साथ धक्का देने के लिए 2 रिपोज़ (ओपनहिफ्ट के एक और आपके गिथब के एक) का उपयोग करना होगा।
ऐसा करने के लिए: एक दूरस्थ नाम "सभी" जोड़ें और इसमें 2 पुश यूआरएल जोड़ें।
git push -u all
प्रतिबद्ध करने और अपना कोड धक्का, के रूप में हमेशा की तरह आगे बढ़ना:: यह 2 रिमोट पर आ जाएगी और OpenShift पर तैनात
git remote add all ssh://[email protected]/~/git/yourapp.git
git remote set-url openshift-git-repo --push --add ssh://[email protected]/~/git/yourapp.git
git remote set-url github-repo --push --add [email protected]:youruser/yourapp.git
फिर दूरदराज के नाम 'सब' डिफ़ॉल्ट दूरस्थ धक्का के रूप में स्थापित
git add .
git commit -m "my commit"
git push
और परिणाम देखने के लिए:
[master 3fc96b2] my commit
1 file changed, 2 deletions(-)
MyLaptop:myapp User$ git push
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 291 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To [email protected]:User/myapp.git
a036a44..3fc96b2 master -> master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 291 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Stopping PHP 5.4 cartridge (Apache+mod_php)
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Building git ref 'master', commit 3fc96b2
remote: Preparing build for deployment
remote: Deployment id is 9037d37a
remote: Activating deployment
remote: Starting PHP 5.4 cartridge (Apache+mod_php)
remote: Application directory "/" selected as DocumentRoot
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://[email protected]/~/git/myapp.git/
a036a44..3fc96b2 master -> master
MyLaptop:myapp User$
उम्मीद है कि यह
स्रोत
2015-05-29 22:35:14
क्या आप इस प्रश्न को प्रमाणित कर सकते हैं? समझना बहुत मुश्किल है। –