2012-09-25 21 views
5

नहीं देख सकता, जबकि सिराडमिन ने गेरिट रेपो स्थापित करने की प्रतीक्षा की, मैंने अपनी खुद की शाखा बनाई। उसने अभी मुझे रेपो का पता भेजा है। मैंने इसे मूल के लिए सेट किया और किसी भी तरह से मेरी आखिरी प्रतिबद्धता को धक्का दिया। रेपो क्लोनिंग ठीक काम करता है, हालांकि git branch -r कुछ भी नहीं देता है। यहाँ क्या हो रहा है?मैं अपनी रिमोट शाखा

$ git init 
# made some comits  
git config remote.origin.url ssh://gerrit.mm-sol.com/branchname 

$ git push origin SH1-of-my-last-commit:master  
error: unable to push to unqualified destination: master  
The destination refspec neither matches an existing ref on the remote nor 
begins with refs/, and we are unable to guess a prefix based on the source ref. 
error: failed to push some refs to 'ssh://gerrit.mm-sol.com/apps/phone-shaker' 

$ git push origin master 
Counting objects: 85, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (85/85), done. 
Writing objects: 100% (85/85), 20.95 KiB, done. 
Total 85 (delta 49), reused 0 (delta 0) 
remote: Resolving deltas: 100% (49/49) 
remote: Updating references: 100% (1/1) 
To ssh://gerrit.mm-sol.com/branchname 
* [new branch]  master -> master 
+0

'गिट फ़ेच मूल' और फिर 'गिट शाखा-आर' का प्रयास करें। – Amber

+0

यदि आपने अभी तक कुछ भी नहीं धक्का दिया है, तो क्लोन रेपो किसी भी शाखा को नहीं दिखाएगा। हालांकि, अंतिम आदेश के बाद यह होना चाहिए। – fork0

+0

@Amber: 'गिट पुश 'रिमोट और रिमोट ट्रैकिंग (स्थानीय शाखा सूचक, रिमोट से मेल खाने वाले) शाखा पॉइंटर्स – fork0

उत्तर

20

इस प्रयास करें:

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" 
git fetch origin 

और उसके बाद फिर git branch -r प्रयास करें।

भविष्य में जब रिमोट की स्थापना, यह git config के बजाय निम्न आदेश का उपयोग करने के लिए प्राथमिकता दी जाती है:

git remote add <remotename> <remoteurl> 

उदा

git remote add origin ssh://gerrit.mm-sol.com/branchname 

यह स्वचालित रूप से दोनों url और fetch विन्यास स्थापित करेगा।

+0

एक और समस्या हल हो गई :) मुझे रिपो-एस क्लोन करने के लिए उपयोग किया जाता है और यह पहली बार ऐसा कर रहा था। तहन्क्स बहुत, एम्बर! – Vorac

1

कोशिश git push -u origin master को

+0

आह, ठीक है। यदि 'गिट रिमोट एड' का उपयोग किया गया था, तो यह किया गया होता, लेकिन सेटअप कमांड कुछ हद तक अधूरा था: 'git config remote.origin.url ...' – fork0

+0

mvitkov @ mms: ~/परियोजना/myproject $ git push - आप मूल मास्टर मूल मास्टर से दूरस्थ शाखा मास्टर को ट्रैक करने के लिए स्थापित शाखा मास्टर। सबकुछ अद्यतित। हालांकि, गिट शाखा-अभी भी कुछ भी वापस नहीं आती है! – Vorac

संबंधित मुद्दे