diff --git a/snippets/autocorrect.md b/snippets/autocorrect.md new file mode 100644 index 000000000..7e4969f58 --- /dev/null +++ b/snippets/autocorrect.md @@ -0,0 +1,17 @@ +--- +title: Autocorrect git commands +tags: configuration,intermediate +--- + +Configures git to autocorrect mistyped commands. + +- Use `git config --global help.autocorrect 1` to enable git's autocorrect. + +```sh +git config --global help.autocorrect 1 +``` + +```sh +git config --global help.autocorrect 1 +git sttaus # Runs `git status` instead +``` diff --git a/snippets/view-status.md b/snippets/view-status.md new file mode 100644 index 000000000..dc5d314b3 --- /dev/null +++ b/snippets/view-status.md @@ -0,0 +1,29 @@ +--- +title: View current status +tags: branch,beginner +--- + +Prints the current status of the working tree. + +- Use `git status` to view the current status of the working tree. +- You can optionally add the `-sb` flag to view the short form of the same output + +```sh +git status [-sb] +``` + +```sh +git status +# On branch patch-1 +# Your branch is up to date with 'origin/patch-1'. +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# 30-seconds.txt +# +# nothing added to commit but untracked files present (use "git add" to track) + +git status -sb +# ## patch-1...origin/patch-1 +# ?? 30-seconds.txt +```