Skip to content

How to Submit a Pull Request

David Keiser-Clark edited this page Dec 13, 2018 · 1 revision

How to Submit a Pull Request to remote origin repo, from a forked repo, using a local clone

Overview: "ISLE-Documentation"

  • Summary: when you're working on a topic/bug/fix/enhancement you will want to create a new branch "from master" so you git branch <helpful name>, git checkout <helpful name> add your work to that branch, then when you want it to go back to your repo git push origin <helpful name> so it goes to YOUR repo. Once you do that it should give you a** URL to perform the PR if you're ready**. Note: If you don't push to origin it won't move your local machine branch to origin.
  • Remote Origin: https://github.com/Islandora-Collaboration-Group/ISLE-Documentation
  • My fork: https://github.com/dwk2/ISLE-Documentation
  • Create a local clone (laptop): git clone https://github.com/dwk2/ISLE-Documentation.git

Workflow

Checkout the master branch of your local repo, fetch all remotes, pull the upstream master, and push it back to your forked repo

Create my local branch, switch to it, do local work, add files, commit, push to origin

  • CREATE NEW BRANCH from master branch for making our desired changes; SWITCH to this new branch

    • usage: git branch NAME-YYYYMMDD-NAME-OF-UPDATE
    • example: git branch dwk2-20181207-cookbook-docker-cheatsheet
  • SWITCH to this new branch

    • usage: git checkout NAME-YYYYMMDD-NAME-OF-UPDATE
    • example: git checkout dwk2-20181207-cookbook-docker-cheatsheet
  • DO YOUR WORK ON THIS BRANCH

  • git status

    • On branch dwk2-20181207-cookbook-docker-cheatsheet
    • Untracked files:
    • (use "git add ..." to include in what will be committed)
    • docs/07_appendices/isle-cheatsheet-docker-commands.md
    • nothing added to commit but untracked files present (use "git add" to track)
  • git add -A

    • add all files
  • git status

    • On branch dwk2-20181207-cookbook-docker-cheatsheet
    • Changes to be committed:
    • (use "git reset HEAD ..." to unstage)
    • new file: docs/07_appendices/isle-cheatsheet-docker-commands.md
  • COMMIT YOUR WORK

    • usage: git commit -m "TYPE OF UPDATE NAME_OF_UPDATE"
    • example: `git commit -m "cookbook for ISLE Cheat Sheet: Docker commands"
      • 1 file changed, 144 insertions(+)
      • create mode 100644 docs/07_appendices/isle-cheatsheet-docker-commands.md`
  • git branch

    • should still be on your new working branch
  • PUSH NEW BRANCH TO ORIGIN

    • usage: git push origin NAME-YYYYMMDD-NAME-OF-UPDATE
    • example: git push origin dwk2-20181207-cookbook-docker-cheatsheet
  • git status

  • git checkout master

  • git status

  • DONE!