First : I create respository on Bitbucket Cloud.
Second : I publish the project code with visual studio with respectively URL from Bitbucket URL.
I hit below issue:
Error encountered while pushing branch to the remote repository: rejected Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes before pushing again.
How to fix it, Thanks.
Hi Nyein Chan Aung and welcome to the community!
The error message that you get indicates that the repository in Bitbucket Cloud contains commits that you do not have locally.
This may be the case
1. either because someone pushed commits to your repository that you do not have locally
2. or because you created a repository in Bitbucket Cloud including a README or .gitignore (these are options in the Create repository page) and then did not clone the repo containing this initial commit.
In this case, your new repository in Bitbucket Cloud will contain a first commit with the README or .gitignore. If you did not clone the repository locally, but you created a new local repo and you are trying to push its code to Bitbucket, then Git will complain because your local repo doesn't have the initial commit that your remote does.
The solution in either case should be pulling any changes from the remote repo first and then you should be able to push your changes.
Please feel free to let me know how it goes and if you have any questions.
Hi @proskilly ,
Does the branch you are working on in Visual studio have an upstream branch configured? If not, that may be a reason why the pull option is disabled. If the upstream branch is configured but you're still having issues with the button being disabled, you may want to reach to Visual Studio support team to figure out why this occurs.
Pulling changes is a common operation when you work on a repo along with other users who push to the branch(es) you are working on, so you need to have the ability to pull changes.
If you have Git Bash installed on your machine, you can navigate to the directory of your local repo, check out the branch you are working on, set the upstream branch with the command
git branch -u <remote>/<branch>
and then you should be able to pull changes with the command
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events