Skip to main content

Section 6.5 Summary

This section is a complete summary of the Git/GitHub process. In some cases, there is more than one way to do a step. I try to provide all methods, but truthfully, I don’t use certain methods. I’ve found a workflow that works for me and I’ve done it so much that the commands are second nature now. You might think about saving this section for future reference.
Some of these pieces are very similar to the summary in Section 4.5, but is designed for collaborative work (where you are editing someone else’s repository). You are welcome to follow the instructions in Section 4.5 and have others edit your files, too.
  1. Navigate to a repository you would like to edit and fork that repository. See Activity 5.1 in Subsection 5.2.1.
  2. Use git clone to clone your fork (not the repo you forked from) on your personal computer. See Git Procedure 4.2.
  3. Create a good branch name (make sure you switch to that branch after you make it). See Subsection 4.1.2 and Subsection 6.1.2.
  4. Edit those files! (Section 6.2)
  5. Follow the three step process as described in Section 6.3. Don’t forget about the usefulness of git status throughout (Subsection 4.3.1)!
    1. Stage your files with git add. See Subsection 4.3.2 and Git Procedure 4.5.
    2. Commit your files with git commit -m. See Subsection 4.3.3 and Git Procedure 4.6.
    3. Push your files back to your fork on GitHub (on your current branch) with git push origin. See Subsection 4.3.4, Subsection 6.3.3 and Git Procedure 4.7.
  6. Create a pull request to merge your changes into your fork’s main branch.
    Or create a pull request to merge your changes from your fork’s branch directly to the authoritative repo’s main branch. See Subsection 6.4.1
  7. Wait for your changes to be merged into the main branch.
  8. After your changes have been merged, pull the changes into your local clone and your fork with git pull upstream main and then git push origin main. Remember to do this often even if you don’t have any pending changes to be merged. See Subsection 6.4.2.
    You may need to set an upstream with git remote add upstream <link> (Git Procedure 6.2)