gitvisual-studioazure-devopsazure-sql-databasedacpac

Getting error while deploying my dacpac file to Azure DevOps generated from Visual Studio for Azure SQL database


I'm creating a .dacpac for my DEV Azure SQL database in Visual Studio so that I can promote changes to PROD env with the help of build and release pipelines in Azure DevOps.

I'm getting error mentioned below and also find in attach:

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

Please help me to get it resolved.

Thank you!

enter image description here


Solution

  • Based on the error message, the reason is the master branch in your local repository is not up to data to that in the remote repository.

    Before you start making changes in the local repository, it is recommended first executing git pull to sync the latest source version from remote to local.


    For your case, you can try the following steps to resolve the issue:

    1. Pick up and copy all the modified files from your local repository to a folder outside the repository.

    2. Execute git pull to sync from remote to local. If you get conflicts, resolve them.

    3. Copy the modified files back to the local repository.

    4. Commit and push the changes from local to remote.