KB0024 - Moving a PowerShell Universal to a new git remote

KB0024 - Moving a PowerShell Universal to a new git remote

Purpose

The purpose of this document is to provide the steps necessary to migrate a PowerShell Universal git repository from one remote to another. 

Overview

PowerShell Universal does not provide this functionality directly in the platform. You will need a git client installed on your machine to follow this process. 
For example, Git for Windows.

Process

1. Create a bare git repository on the target remote. 
2. If you have configured git sync in the PowerShell Universal admin console, navigate to Settings \ Git, click Git Settings and then click Reset. 
3. Stop the PowerShell Universal service. 
4. Navigate to the PowerShell Universal repository and run the following commands: 
  1. git remote set-url <remote name> <target git repository> 
  2. git push
An example of this command would be: 
  1. git remote set-url origin https://github.com/ironmansoftware/fuzzy-giggle.git
  2. git push
After running the command, your PowerShell Universal configuration files will be present in the new repository. 
5. If you have configured git settings within appsettings.json, update your git settings to reflect the new git remote. 
6. Start the PowerShell Universal service. 
7. If you have configured git settings within the admin console, navigate to Settings \ Git and click Git Setting. Enter the new git remote settings.