Skip to content

Instantly share code, notes, and snippets.

@anuviswan
Last active August 6, 2023 11:06
Show Gist options
  • Save anuviswan/5f520a3b3b1ec92913c70ee93cc14d44 to your computer and use it in GitHub Desktop.
Save anuviswan/5f520a3b3b1ec92913c70ee93cc14d44 to your computer and use it in GitHub Desktop.
Git Cheatsheet

List which files are staged, unstaged, and untracked.

$ git status

Add files

$ git add 'fileName'

Commit changes

$ git commit -m "commit message"

Push changes to 'main' branch

$ git push origin main

Clear Local Branches

Clear all branches except for master locally

git branch | grep -v "master" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment