Pchałem do zdalnego repozytorium Bitbucket, a ostatnio mój kolega przesłał nową gałąź, którą utworzył, do tego samego repozytorium.
Próbuję pobrać przesłane przez niego zmiany.
$ git branch -a
* master
localbranch1
localbranch2
remotes/origin/master
$ git branch -r pochodzenie / wzorzec
W interfejsie użytkownika sieci Bitbucket widzę utworzoną przez niego gałąź. W jaki sposób mogę to zrobić?
Następna próba:
$ git fetch bitbucket
Password for 'https://xxxxx@bitbucket.org':
From https://bitbucket.org/user/repo
* branch HEAD -> FETCH_HEAD
Jeśli utworzona przez niego gałąź nazywa się new_branch_b, czy powinienem spodziewać się następującego komunikatu?
$ git branch -r
origin/master
origin/new_branch_b
Trzecia próba:
$ git remote update
Fetching bitbucket
Password for 'https://xxxxx@bitbucket.org':
From https://bitbucket.org/user/repo
* branch HEAD -> FETCH_HEAD
$ git branch -r
origin/master
Czwarta próba:
[remote "bitbucket"]
url = https://user@bitbucket.org/user/repo.git
Zadzwoniłem bitbucketraczej do pilota niż pochodzenia (przynajmniej to pamiętam; ustawiłem to jakiś czas temu)
Piąta próba:
Zaktualizowałem zdalną konfigurację Bitbucket zgodnie z odpowiedzią kan :
$ git config -e
[remote "bitbucket"]
url = https://user@bitbucket.org/user/repo.git
fetch = +refs/heads/*:refs/remotes/bitbucket/*
Dla większości ludzi będzie to nazywane pochodzenie:
[remote "origin"]
url = https://user@bitbucket.org/user/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
Potem,
$ git remote update
Fetching bitbucket
Password for 'https://user@bitbucket.org':
remote: Counting objects: 48, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 35 (delta 21), reused 0 (delta 0)
Unpacking objects: 100% (35/35), done.
From https://bitbucket.org/user/repo
* [new branch] branch_name1 -> origin/branch_name1
* [new branch] branch_name2 -> origin/branch_name2
.... i tak dalej.
Myślę, git fetch originże też by działał dla git remote update.
git fetch originspełnia swoje zadanie
refs/remotes/bitbucket/*zamiast tego miało większy sensrefs/remotes/origin/*.