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.
Hi, @Juan Martinez! 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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
I hope this helps, but do let me know if you face any obstacles.
Kind regards,
Caroline
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.