tốt nhất để được giải thích một ví dụ: Tôi đang trên cành 0,58 của kho lưu trữ và điều này mình làm thế nào tôi kéo:git: Sự khác biệt giữa "BRANCHNAME" và "refs/head/BRANCHNAME"
git pull origin 0.58
Khi tôi chỉ gọi "git pull", tôi nhận được:
ip238:openlierox az$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.0.58.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.0.58.remote = <nickname>
branch.0.58.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
Dường như tôi có thể quên một số tùy chọn (--track?) khi tôi kiểm tra nhánh đó. Dù sao, tôi đã thiết lập điều này ngay bây giờ:
git config branch.0.58.merge 0.58
git config branch.0.58.remote origin
Và điều này dường như hoạt động. Sau đó, chỉ vì quan tâm, tôi đã xem xét một số chi nhánh khác về những thiết lập:
ip238:openlierox az$ git config branch.0.57.merge
refs/heads/0.57
ip238:openlierox az$ git config branch.0.57.remote
origin
tôi đã tự hỏi bây giờ, là có một sự khác biệt giữa "0,58" hay tôi nên xác định "refs/heads/0,58" ?
Sự khác biệt chính xác là gì?
Cảm ơn rất nhiều, điều này giải thích rất rõ. Nó chỉ làm việc với "0,58" đơn giản vì không có thẻ có tên như vậy. – Albert
Phải, về cơ bản nó sẽ luôn hoàn toàn ổn, nhưng tốt nhất là an toàn. – Cascabel