Git & GitHub Usage

Workflow

Terminology

Keep in mind the following when working with Git:

  • Repo/Codebase: Short for repository; where our code is stored on GitHub. Also know as a project.

  • Commit: A singular saved version of the repository. When a programer is ready they can commit the code so it is saved within git. A snapshot of the project that records the changes that were made since the last commit. It is a permanently saved record in the projects history.

  • Remote Repository: (For our purposes) A repository hosted on the web so that Git can sync the repository across different devices and users. Our code is available on GitHub (https://github.com/MontclairRobotics), which is a website that hosts Git Repositories on the web.

  • Clone: To start editing in a remote repository you must first clone it to you computer. This means you have Git on your computer with a copy of the repository and all of it’s history that can now edit directly on your computer. This is referred to as the “local” repository.

  • Push/Pull: After you commit, you will wish to push your commits and other changes to the remote, and Pull changes made to the remote onto your computer. In other words to sync your Git with GitHub including all commits. Pulling is fetching changes from the remote repository and merging the changes into your local repository. Pushing is sending your local changes to the remote repository.

  • Merge: For example, if changes have been made to the code since you started editing it, you will need to merge the code you wrote with the new version of the code. Simply put you need to merge two different versions of the same code into a singe version. If the changes each version made do not interfere with each other, then Git will usually be able to merge automatically. However if you need to merge to versions with changes that do interfere with each other, that is called a merge conflict. You will need to manually select which lines from each version will be combined into the final version. The action of taking two versions of code and combining them into one. This can be done with two commits (often from different branches) or uncommitted changes.

  • Branch:

  • Pull Request:

  • Code Review:

  • Stash: (including Pop)

  • Origin:

  • Git States:

  • Stage Changes:

  • HEAD:

  • Checkout:

  • Detached Head:

  • Desktop Application:

  • GitHub Issues:

  • GitHub Actions: (do we need this)