From f7104111a4c756684f8048a1955e5f5ffe6b3c99 Mon Sep 17 00:00:00 2001 From: gav1 Date: Sun, 8 Jul 2018 18:23:57 -0500 Subject: [PATCH] Initial commit; minor edits to formatting and separated Terminal commands into their own section --- README.md | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 3972224..f025582 100644 --- a/README.md +++ b/README.md @@ -2,41 +2,35 @@ A cheatsheet of Git commands. -- [cd, ls](#navigate) +- [cd, ls](#terminal-navigation) - [git init, git config](#git-setup) +- [status, log](#state-checking) - [editor](#git-editor) - [git remote](#remote-branch) - [git add, git commit](#add-and-commit) - [delete local and remote branch](#delete-local-and-remote-branch) -## navigate +## terminal navigation * navigate to a particular folder ```bash cd "" ``` + * navigate up a folder ```bash cd .. ``` + * navigate to your home folder ```bash cd ``` + * list items in current folder ```bash ls ``` -* check git status -```bash -git status -``` -* check git log -```bash -git log # too verbose -git log --oneline # condenses to a single line -git log --oneline -n 5 # prints only the last 5 commits -``` ## git setup @@ -45,17 +39,20 @@ git log --oneline -n 5 # prints only the last 5 commits cd "" git init ``` + * check global and local git settings ```bash git config --global -l git config --local -l ``` + * configure global git settings (cd anywhere) ```bash git config --global user.name "" git config --global user.email "" git config --global core.editor "nano -w" ``` + * configure local git settings ```bash cd "" @@ -63,7 +60,22 @@ git config --local user.name "" git config --local user.email "" ``` -### git editor +## state checking + +* check git status +```bash +git status +``` + +* check git log +```bash +git log # too verbose +git log --oneline # condenses to a single line +git log --oneline -n 5 # prints only the last 5 commits +``` + +## git editor + * check editor version and run ```bash nano --version @@ -74,7 +86,7 @@ emacs --version emacs ``` -### remote branch +## remote branch ```bash git remote -v # the remote branch is named origin in this example @@ -82,7 +94,7 @@ git remote add origin git remote set-url origin ``` -### add and commit +## add and commit ```bash # add git add @@ -91,8 +103,8 @@ git add . # danger, this stages all changes git commit -m "Message" ``` -### delete local and remote branch +## delete local and remote branch ```bash -git branch -d +git branch -D git push origin : -``` \ No newline at end of file +```