8.5 General workflow advice

Working with git with GitHub and GitKraken is extremely powerful. Beyond the collaboration opportunities discussed above, it also helps keep your work more open and transparent. Further, as we’ll discuss later in the book, GitHub provides ways of publishing your work online (e.g., data dashboards, websites) and numerous applications integrate with GitHub to provide additional services. While not discussed here, GitHub Actions are also extremely powerful and can automate many operations (e.g., unit testing). However, all of this can also be a bit intimidating when getting started. We recommend the following workflow:

  • Create a repo
  • Add collaborators
  • Always pull before starting new work
  • Always commit all changes before finishing your work
  • File Issues to track work that should be completed
    • Include assignments for individuals
    • Tag issues to help with organization
  • Use branches to create new changes
  • Submit pull requests when the work on a given branch is complete, and link it to the corresponding issue
    • Tag collaborators to review the pull request
    • Use GitHub’s review resources to comment on individual lines of code, as needed
    • Use the PR to have conversations about the changes and any revisions needed
  • Merge pull requests and delete the remote branch
    • Move back to your local, checkout the main branch, pull the merged changes, delete the local branch

The above should help avoid merge conflicts, but it is still important to stay in communication with your collaborators so you don’t end up out of sync.