From 1646af51e30f43eaf75e0eb7da4639bd5998a9ff Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 28 Oct 2015 00:25:48 -0400 Subject: [PATCH 1/2] Describe help for commonly-used Git commands with examples This patch adds the command `git help everyday`, which shows a man-page that comes with Git describing the most common commands for everyday usage. The tip is specifically at the top of the list on the grounds that it is the fastest way to find help for performing basic operations in Git, which is very useful to people new to Git. Signed-off-by: Eric James Michael Ritz --- README.md | 6 ++++++ tips.json | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 03fedce..5a14cc8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ +* [Everyday Git in twenty commands or so](https://github.com/git-tips/tips#everyday-git-in-twenty-commands-or-so) * [Overwrite pull](https://github.com/git-tips/tips#overwrite-pull) * [List of all files till a commit](https://github.com/git-tips/tips#list-of-all-files-till-a-commit) * [Git reset first commit](https://github.com/git-tips/tips#git-reset-first-commit) @@ -70,6 +71,11 @@ +## Everyday Git in twenty commands or so +```sh +git help everyday +``` + ## Overwrite pull ```sh git fetch --all && git reset --hard origin/master diff --git a/tips.json b/tips.json index d796ff4..3b52904 100644 --- a/tips.json +++ b/tips.json @@ -1,4 +1,8 @@ [ + { + "title": "Everyday Git in twenty commands or so", + "tip": "git help everyday" + }, { "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" @@ -241,7 +245,7 @@ "tip": "git bundle create " }, { - "title": "Import form a bundle", + "title": "Import from a bundle", "tip": "git clone repo.bundle -b " }, { From c46f0499748fd66a31237774097731752f28ae44 Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 28 Oct 2015 00:32:07 -0400 Subject: [PATCH 2/2] Add a tip for automatically stashing changes before a rebase Signed-off-by: Eric James Michael Ritz --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 5a14cc8..edd9746 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ * [Import from a bundle](https://github.com/git-tips/tips#import-from-a-bundle) * [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch) * [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog) +* [Stash changes before rebasing](https://github.com/git-tips/tips#stash-changes-before-rebasing) @@ -449,5 +450,10 @@ git rev-parse --abbrev-ref HEAD git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog ``` +## Stash changes before rebasing +```sh +git rebase --autostash +``` + diff --git a/tips.json b/tips.json index 3b52904..e3abadc 100644 --- a/tips.json +++ b/tips.json @@ -255,5 +255,9 @@ { "title": "Ignore one file on commit (e.g. Changelog).", "tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog" + }, + { + "title": "Stash changes before rebasing", + "tip": "git rebase --autostash" } ]