git pull doesn't update immediately remote repo
Asked by Juan Martinez:

When I create a branch in Bitbucket (always using develop as the origin branch) I go to my terminal, checkout to develop and perform a git pull.

The command pulls all the changes made and updates all the branches created by other developers except for the one I recently created.

Then I have to be using git pull for about 20 or 30 minutes receiving the message "Already up to date." until suddenly it starts tracking the branch I created.

This happens specially with repos cloned using https.

Is there some kind of cache data using https which takes a long time to update the data?

Do I have some wrong configuration on my local set-up? It seems I'm the only one on my team seeing this.


Answers:
author: Caroline R
body: Hi, [@Juan Martinez](/t5/user/viewprofilepage/user-id/4558621)! Welcome to the community!

In order to further investigate this case, could you please confirm the exact commands that you are using during this process, including how you are creating the branch?

Also, instead of creating the branch locally and then pushing this to the remote repo, I understand you are creating the new branch on your remote repo and then pulling this information to your local repository, is that correct? If that's the case, could you give me more details about your business case for that?

Thank you! Feel free to share any additional information regarding this case.

Kind regards,  
Caroline

comments: author: Juan Martinez
body: Hi Caroline,

Yes that's correct I'm creating the branch in the remote repo and then trying to pull the info to my local repo.

I create the branch from the Jira ticket, which basically opens Bitbucket and then I create the branch there.

Most of the times I'm working on "old-feature-branch" for example, so after creating the branch in Bitbucket I use:

```
git checkout develop
```

Once in develop I use:

```
git pull
```

This is where everything new in the remote repo is updated, except for the recently created branch.

When creating the branch I always use develop as base, I have tried with different servers and using https and ssh to clone the repo.

If you need more details please let me know.


author: Caroline R
body: Hi, Juan! Thank you for the additional details.

In fact, when you create a remote branch and run just a **git pull** , if you run **git branch** , you won't be able to see this branch on your repo. However, if you run **git branch -r** , you should be able to see this branch on the remote (**-r** will show you all the remote branches).

So, in order to be able to work on this branch on your local repository, you will need to "checkout" the new branch. If you access your branch on your remote repository, you will see the **Check out** button. Click on this option and it will open a window with the following command, so you can just copy and paste this on your local repository:

```
git fetch && git checkout {branch_name}
```

Image:

![Screen Shot 2021-09-27 at 4.40.59 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/162340i5A59273BBA946856/image-dimensions/309x255?v=v2 "Screen Shot 2021-09-27 at 4.40.59 PM.png")

I hope this helps, but do let me know if you face any obstacles.

Kind regards,  
Caroline


Tags: atl-gruland

bitbucket-cloud

cloud

https

pull-request