Skip to content

Instantly share code, notes, and snippets.

@KristofferRisa
Last active September 1, 2019 07:50
Show Gist options
  • Save KristofferRisa/97e17b38a0cace8d6b26edeb10dc279e to your computer and use it in GitHub Desktop.
Save KristofferRisa/97e17b38a0cace8d6b26edeb10dc279e to your computer and use it in GitHub Desktop.
Just some basic git commands. (used in kristoffer.dev/blog/basic-git-commands)
# adds files to index
git add <file>
# create a new branch
git branch [branch-name]
# see all branches
git branch -a
# switch between branches
git checkout [branch-name]
# Clones a remote repository into a new directory
git clone
# commit changes in the index
git commit
# Initialize a local repository
git init
# Pulls the latest version from remote repository
git pull
# Pushes local repository to remote repository
git push
# check status of the working tree
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment