Skip to content
Agne Lukoseviciute edited this page Dec 6, 2021 · 10 revisions

Contributing to Microsoft/react-native-windows

If this is your first time, below are some more detailed steps for getting your branch set up and submitting a PR.

Setting up your branch for changes

For each bug or task you complete, it is recommended that you start with a fresh branch. If you have any lingering changes in your current branch that you want to save, go ahead and commit them. If you are just beginning, then you are good to go. On github, navigate to your repository which should be forked from Microsoft/react-native-windows. If you haven't already created a fork, follow the steps in Git branch Setup. Above the list of files is a dropdown that should say master. Use the dropdown to create a new branch and name is according to what you will be working on. (I.e. DropdownHighlight, CleanUpExamples, etc). Now you have created a new branch.

When using the command line, you will want to make sure you have your branch locally. It takes time for it to show up automatically, so you can make it show by running git remote update origin –prune in your command prompt from the root. Run git branch -a to see if your new branch shows up. Now you will want to check out your branch locally. You can do this with git checkout -b branch-name. Confirm you are now working out of the branch with git branch.

Make the fix

Now that your branch is set up and ready for commits, go ahead and fix the bug you are working on or make some small change that you want to check in.

Verify your changes

Manually test your fix, and ensure that all tests are in a good state

Commit your changes

To stage files using the command line, you need to run git add <filename> for each file. You can also look up how to add all files with changes under a directory. Next you will want to commit changes with git commit –m "This change updates the padding in the dropdown"

You can commit multiple times until you are ready to make a pull request. You should keep the message short since it will not be used in the bug notes and is just for keeping track of the multiple commits in one pull request.

Creating a Pull Request

Run git push in your command line.

This will push any staged files you have in your branch.

Now go back to your fork on GitHub. You should see a yellow bar at the top with your change and a button that says "Compare & Pull Request". Click that button.

Click "Create Pull Request".

A bunch of tests will automatically kick off to verify your PR. The tests marked as required must pass before a PR can be merged. Currently the Azure Dev Ops tests will not kick off automatically. -- These have to be kicked of by a team member.

Someone will also have to review your change before the change is allowed to be merged in. They may ask questions for more information or ask you to change things. Be sure to respond to their comments and push additional changes to the branch if they ask you to modify things before they sign off.

Now you are done! Celebrate!