Skip to content

Git Commands

MorrisYLin edited this page Sep 30, 2024 · 9 revisions

Common git commands

  • git status: Displays the current state of your working directory and staging area.
  • git clone <repo-url.git>: Copies a remote repository to your computer.
  • git add <file(s), dir>: Stages changes to be committed.
  • git rm <files(s), dir>: Removes files from tracking.
  • git commit -m "message": Saves staged changes to the local repository. Use -m to avoid having to use vim.
  • git push: Uploads local commits to a remote repository.
  • git pull: Fetches and merges changes from a remote repository into your local branch.
  • git switch <branch-name>: Changes branches.

This guide is a short and good idea of how Git works. Please look through it!

Naming Branches

To know what we're looking at when we check out a branch, we have the following naming patterns for branches in this repository:

main

main is the main branch of the repository. This branch is protected (meaning not everyone can change it willy-nilly) and is reserved for revisions that we know are functional. To contribute, create a feature/* branch, make your changes, and create a pull request!

feature/*

feature/* represents any *new* stuff we're working on. So, if you're making something new, create a new branch starting with feature/ and go to town.

board/*

board/* is reserved for branches that are mainly working on a single board. Typically, feature branches are merged into this one, and these are, upon completion, merged into main.

Clone this wiki locally