Creating a new branch - DOI-ONRR/nrrd GitHub Wiki

Branches are where we make changes to a specific part of the website before committing the changes to dev. These are the steps you need to take to create and commit branches in Github before preparing a pull request.

  1. Open Github Desktop and set the current repository to the one you are updating. Screenshot of Github Desktop with current repository, current branch, and pull origin sections highlighted

  2. Set the current branch to dev.

  3. Pull origin. You can do this by either hitting the Pull Origin button or clicking the down arrow next to Pull Origin. The button and the down arrow will only display if there are commits in dev that you don’t currently have on your machine. If there is anything available for you to click on that says pull origin – do it before proceeding.

  4. Create a new branch by opening the current branch menu and hitting ‘New branch.’ Screenshot of Github desktop with new branch button highlighted

  5. Enter a branch name into the text box, then hit Create branch. Make sure your branch name is brief and explains what it’s for. The name is case sensitive and is what will go into the preview URL for the pull request.
    Screenshot of Github desktop with create branch name text entry box highlighted

  6. With the new branch open in Github Desktop, open Atom on your machine. Go to File-Open Folder and Select the repository you are working with. Screenshot of Atom with Open Folder command highlighted

  7. Make sure the lower left corner is set to your branch. It should show your branch name and if you have pulled origin before opened Atom, there should be no number or pulls listed. It should just say Fetch. If it shows something other than the branch you just created, click on the branch name and choose yours from the drop down. Screenshot of Atom with current branch highlighted

  8. Make your changes in Atom and save.

  9. Return to Github Desktop. Your changes will be listed on the left. Make sure that the boxes next to all your changes are checked.

  10. Enter the summary. No need to add a description, but make the summary detailed enough so that someone else looking at this commit knows what to look for. Screenshot of Github summary text box and commit button

  11. Hit the blue “Commit to [branch name]” button.

  12. Now the Publish Branch button will display in Github. Use that to initiate creating a pull request and follow the instructions on the How to prepare and review pull requests page.