Trong khi chờ sysadmin thiết lập repo gerrit, tôi đã tạo chi nhánh của riêng mình. Anh ấy vừa gửi cho tôi địa chỉ của repo. Tôi đặt nó cho nguồn gốc và bằng cách nào đó đã đẩy cam kết cuối cùng của tôi. Nhân bản repo hoạt động tốt, tuy nhiên git branch -r
không trả về gì cả. Chuyện gì đang xảy ra ở đây?Tôi không thể thấy chi nhánh từ xa của mình
$ 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
Hãy thử 'git fetch origin' và sau đó chọn' git branch -r' lần nữa. – Amber
Nếu bạn chưa đẩy bất cứ điều gì, repo nhân bản sẽ không hiển thị bất kỳ chi nhánh nào. Nó nên có sau khi lệnh cuối cùng, mặc dù. – fork0
@Amber: 'git push' cập nhật cả theo dõi từ xa và theo dõi từ xa (con trỏ nhánh địa phương, phù hợp với từ xa) con trỏ chi nhánh – fork0