docs/branch-setup.md
This document describes how to set up your development environment and contribute changes to the microsoft/react-native-windows project. This document assumes basic working knowledge with Git and related tools. We are providing instructions specific to this project.
If you wish to contribute changes back to the microsoft/react-native-windows repository, start by creating your own fork of the repository. This is essential. This will keep the number of branches on the main repository to a small count. There are lots of developers in this project and creating lots of branches on the main repository does not scale. In your own fork, you can create as many branches as you like.
https://github.com/johndoe/react-native-windows.git. Notice how your GitHub username is in the repository location.> git clone https://github.com/johndoe/react-native-windows.git
Before starting to contribute changes, please setup your upstream repository to the primary microsoft/react-native-windows repository.
git remote -v, you should see only your fork in the output list> git remote -v
origin https://github.com/johndoe/react-native-windows.git (fetch)
origin https://github.com/johndoe/react-native-windows.git (push)
> git remote add upstream https://github.com/microsoft/react-native-windows.git
git remote -v should show the upstream repository also> git remote -v
origin https://github.com/johndoe/react-native-windows.git (fetch)
origin https://github.com/johndoe/react-native-windows.git (push)
upstream https://github.com/microsoft/react-native-windows.git (fetch)
upstream https://github.com/microsoft/react-native-windows.git (push)
Create a branch from your fork and start making the code changes. We recommend using SourceTree for working in your repo. Once you are happy with the changes, and want to merge them to the main microsoft/react-native-windows project, create a pull request from your branch directly to "microsoft/react-native-windows main".
Members on the microsoft/react-native-windows core team will help merge your changes.
From time to time, your fork will get out of sync with the upstream remote. Use the following commands to get the main branch of your fork up to date.
> git fetch upstream
> git checkout main
> git pull upstream main
> git push
Use these commands instead if you would like to update your current branch in your fork from the upstream remote.
> git fetch upstream
> git pull upstream main
> git push