-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Public to Private Migration
This guide will outline the steps necessary from moving development in the public repository to the private repository.
Please ensure that the following steps are completed before making any changes:
- Create your own fork from the private repository
- Click the
Fork
button in the top-right corner of the private repository
- Click the
- Clone your fork to your machine
- In your development folder, open Git Bash and run
git clone https://github.com/<GITHUB_USERNAME>/azure-powershell-pr.git
- In your development folder, open Git Bash and run
- Create a new remote repository for the Azure fork of the private repository
- In the root of the repository, open Git Bash and run
git remote add upstream https://github.com/Azure/azure-powershell-pr.git
- This will create a remote called
upstream
; feel free to use name besidesupstream
for this remote. The examples to follow will useupstream
.
- This will create a remote called
- In the root of the repository, open Git Bash and run
If you are looking to create a new branch in the private repository to work out of, follow the below steps in the clone of your fork of the private repository:
- Fetch the latest changes from the Azure fork of the private repository
- Run
git fetch upstream
- Run
- Create a branch based off of the
preview
branch in the Azure fork- Run
git branch <DEV_BRANCH> upstream/preview
- Run
- Switch to your development branch
- Run
git checkout <DEV_BRANCH>
- Run
- Push the branch to your private fork
- Run
git push origin <DEV_BRANCH>
- Run
You can now open a pull request from your fork to the Azure fork in the private repository with the changes in your development branch.
If you have an existing branch that you are working out of in the public repository and want to move the changes over to the private repository, follow the below steps in the clone of your fork of the private repository:
- Create a new remote repository for your fork of the public repository.
- Run
git remote add origin-public https://github.com/<GITHUB_USERNAME>/azure-powershell.git
- This will create a remote called
origin-public
; feel free to change this to whatever you are used to or comfortable with
- This will create a remote called
- Run
- Fetch the latest changes from your public fork
- Run
git fetch origin-public
- Run
- Create a branch based off of your development branch in your public fork
- Run
git branch <DEV_BRANCH> origin-public/<DEV_BRANCH>
- Run
- Switch to your development branch
- Run
git checkout <DEV_BRANCH>
- Run
- Push the branch to your private fork
- Run
git push origin <DEV_BRANCH>
- Run
You can now open a pull request from your fork to the Azure fork in the private repository with the changes in your development branch.
If a branch was created for you in the Azure fork by the PowerShell team, and you would like to work out of the Azure fork instead of your own fork, follow the below steps in the clone of your fork of the private repository:
- Fetch the latest changes fromt he Azure fork of the private repository
- Run
git fetch upstream
- Run
- Create a branch based off of the created branch in the Azure fork
- Run
git branch <DEV_BRANCH> upstream/<DEV_BRANCH>
- Run
- Switch to your development branch
- Run
git checkout <DEV_BRANCH>
- Run
- Push any changes to the created branch in the Azure fork
- Run
git push upstream <DEV_BRANCH>
- Run
Note: it is preferred that you create a branch from your own fork and work out of that instead of working out of the Azure fork. To do so, follow the same steps above and push to your fork instead of the Azure fork by running git push origin <DEV_BRANCH>
.