Search code examples
gitazure-devopsversion-control

Updating airgaped Azure devops git repository from a local git folder


I am working with some air-gaped systems and as part of the deployment, I need to update the sources for an external git repository to one of the Azure Devops on-premise air-gaped repository. First time I extracted the source and did the following.

git remote remove origin
git remote add origin <url to the air-gaped Azure devops empty repository>
git push -u origin --all

I want to update it with new source changes but I am not sure how to go about it. Should I just overwrite the local directory with the update source and do the same as before ? I just don't want to mess things up. What is a better way do this over and over again in Azure devops.


Solution

  • The best way to do this is with git bundle create. This creates a repository bundle that you can transfer to the remote machine, and fetch from as if it were a repository.

    Once you've transferred the archive, you can do git bundle verify on the bundle file and then simply fetch or pull from it as normal.