Git cheatsheet

Published 6 months ago: July 13, 2020

Updated: October 26, 2020


Git cheatsheet

This cheatsheet is a small collection of handy snippets for quick reference in tricky situations. Feel free to suggest edits, propose additions, complain about something, disagree with content or such and the like. Every feedback is a welcome one.

Commands

Initializes/creates a new repository
git init

Clone a repository into current working directory
git clone

View changes since last commit
git status

View untracked files, expanding subdirectories
git status -u

Add file to commit
git add <filename>

Skip editor, directly adding commit message
git commit –m "message describing commit"

Commit all edits
git commit -a

send master branch to remote repository
git push origin master

Update local repository with master branch
git pull


Christoffer Lybekk

Developer under development

Explore more articles with similar tags

GitSyntaxCheatsheet

Article stats


words

sentences

paragraphs

null minread time