나는 원격 Bitbucket 저장소로 밀고 왔으며 최근 동료는 그가 만든 새로운 지점을 동일한 저장소로 밀어 넣었습니다.
그가 업로드 한 변경 사항을 가져 오려고합니다.
$ git branch -a
* master
localbranch1
localbranch2
remotes/origin/master
$ git branch -r origin / 마스터
Bitbucket의 웹 UI에서 그가 만든 지점을 볼 수 있습니다. 어떻게해야합니까?
다음 시도 :
$ git fetch bitbucket
Password for 'https://xxxxx@bitbucket.org':
From https://bitbucket.org/user/repo
* branch HEAD -> FETCH_HEAD
그가 만든 브랜치가 new_branch_b 라면 다음을 볼 수 있을까요?
$ git branch -r
origin/master
origin/new_branch_b
세 번째 시도 :
$ 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
네 번째 시도 :
[remote "bitbucket"]
url = https://user@bitbucket.org/user/repo.git
나는 bitbucket원산지보다는 리모컨을 불렀다. (적어도 그것은 내가 기억하는 것이다; 나는 얼마 전에 그것을 설정했다)
다섯 번째 시도 :
칸의 답변에 따라 Bitbucket 원격 구성을 업데이트했습니다 .
$ git config -e
[remote "bitbucket"]
url = https://user@bitbucket.org/user/repo.git
fetch = +refs/heads/*:refs/remotes/bitbucket/*
대부분의 사람들에게 그것을 원산지라고 부릅니다.
[remote "origin"]
url = https://user@bitbucket.org/user/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
나중에,
$ 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
.... 등등.
나는 git fetch origin또한 일할 것이라고 생각한다 git remote update.
git fetch origin일을
refs/remotes/bitbucket/*대신에 사용하는 것이 더 합리적 이었습니다refs/remotes/origin/*.