I have been pushing to a remote bitbucket repo and recently a colleague has pushed a new branch he created to the same repo.
I'm trying to fetch the changes he uploaded.
$ git branch -a * master localbranch1 localbranch2 remotes/origin/master $ git branch -r
origin/master
In the web ui for bitbucket I can see the branch he has made. Any help/advice/direction would be most appreciated. Thanks.
Any futher info you need just ask.
EDIT 1
$ git fetch bitbucket Password for 'https://xxxxx@bitbucket.org': From https://bitbucket.org/user/repo * branch HEAD -> FETCH_HEAD If the branch he created is called new_branch_b should I be expecting to see:
$ git branch -r origin/master origin/new_branch_b EDIT 2
$ 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 EDIT 3
[remote "bitbucket"] url = https://user@bitbucket.org/user/repo.git I called the remote bitbucket rather than origin (at least that's what I recall, I set it up a while ago)
EDIT 4
I updated the bitbucket remote config as per kan's answer.
$ git config -e
[remote "bitbucket"] url = https://user@bitbucket.org/user/repo.git fetch = +refs/heads/*:refs/remotes/bitbucket/* For most people it will be called origin
[remote "origin"] url = https://user@bitbucket.org/user/repo.git fetch = +refs/heads/*:refs/remotes/origin/* Afterwards
$ 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 .... and so on.
I think git fetch origin would also work for git remote update
Thanks to everyone who helped me with this problem.