sysadminがgerritリポジトリをセットアップするのを待つ間に、自分でブランチを作成しました。彼はちょうど私にレポの住所を送った。私は起源のためにそれを設定し、何とか私の最後のコミットをプッシュした。 レポのクローニングは正常に機能しますが、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
'git fetch origin'と' git branch -r'をもう一度試してみてください。 – Amber
まだ何もプッシュしていない場合、クローンされたレポはブランチを表示しません。しかし、それは最後のコマンドの後になければなりません。 – fork0
@Amber: 'git push'は、リモートとリモートの両方のトラッキング(リモートにマッチするローカルブランチポインタ)を更新します。 – fork0