- Azure DevOps Server 2019 Cookbook(Second Edition)
- Tarun Arora Utkarsh Shigihalli
- 207字
- 2021-06-24 14:18:35
There's more...
If the Git repository was initialized at the time of creation by having a new README.md file added to it, then the Git repository on the server and the local will have a history that is unrelated:
In this situation, you'll have to explicitly link the local branch with the branch on the remote. Associate the local branch with an upstream branch:
git branch --set-upstream-to=origin/master
Visual Studio Code detects that a remote has been added for this local Git repository and that the local branch and the upstream branch are not in sync. Since the history in the remote repository and the history in the local repository aren't related yet, use the --allow-unrelated-histories switch to pull the changes from the remote repository into the local repository:
git pull origin master --allow-unrelated-histories
Push the changes from your local repository into the remote by clicking on the push icon in the Visual Studio Code status bar:
Navigate to the myWebApp Git repository in Azure DevOps Server's partsunlimited web portal, then click on History to see the history of changes. The graph of history reflects that the code histories of the local repository and the remote were not related before being pushed into the remote repository: