Git Best Practices - Autonomous-Motorsports-Purdue/Electrical_Documentation GitHub Wiki

Branching

  • The very first thing you should do when you want to make changes to files in one of the GitHub repos is to create a feature branch where you will do all of your work
  • You can create a branch either on the GitHub website, GitHub Desktop, or with Git Bash.
  • The branch name should be descriptive of the feature you're adding or have the following syntax: [name]Dev e.g. loganDev

Commits & Pushing

  • You will want to commit your changes to your branch often with descriptive commit messages.
  • Push your changes to your branch when you finish working

Collaborating within a single branch

  • Before you start working you will need to pull, to make sure your local files are up to date with any changes that have been made to the branch
  • When collaborating with others in a single branch it is critical to commit your changes frequently, and necessary to commit your changes after you have finished working

Pull Requests (PRs)

  • When a feature is finished you will want to create a PR to merge the changes you have made with the repository that you originally branched from
  • It is recommended that you complete this process from within the GitHub website
  • Leave a meaningful description of the changes in the dialogue
  • All PRs MUST be reviewed, add reviewers on the right-hand side of the description dialogue (if you are unsure of who should be added as a reviewer talk to your project lead)
  • Create the pull request (don't do anything after this)
  • Wait for the request to be reviewed, do not merge the request yourself