From 76c268f2843c98430202f031178b1898a7450dc1 Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 29 Jul 2015 18:54:45 -0400 Subject: [PATCH 1/3] Describe how to list ignored files This tip shows how to list all ignored files in a project, which will take into account not only any `.gitignore` file within a repository, but also any globally defined list of exclusions such as `/home/eric/.gitexcludes` and `.git/info/exclude` within the repository itself. 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 a4fc9ad..fef9feb 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ * [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) * [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files) * [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files) +* [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) @@ -239,5 +240,10 @@ git ls-files -t git ls-files --others ``` +## Show all ignored files +```sh +git ls-files --others -i --exclude-standard +``` + diff --git a/tips.json b/tips.json index 72b80b2..788eedd 100644 --- a/tips.json +++ b/tips.json @@ -135,5 +135,9 @@ { "title":"Show all untracked files", "tip":"git ls-files --others" + }, + { + "title": "Show all ignored files", + "tip": "git ls-files --others -i --exclude-standard" } ] From 3e926cdc9efe7ec431c0f1b4819d44205a6b0b6c Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 29 Jul 2015 18:58:03 -0400 Subject: [PATCH 2/3] Describe how to reword the most recent commit message This is useful for when you realize that you forgot to mention something important, made a typo, etc. Obviously you should avoid using this on a commit which you have already pushed. 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 fef9feb..6f8ed1d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ * [Delete local branch](https://github.com/git-tips/tips#delete-local-branch) * [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch) * [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head) +* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message) * [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url) * [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references) * [Get list of all local and remote branches](https://github.com/git-tips/tips#get-list-of-all-local-and-remote-branches) @@ -130,6 +131,11 @@ git push origin : git checkout -- ``` +## Reword the previous commit message +```sh +git commit -v --amend +``` + ## Changing a remote's URL ```sh git remote set-url origin diff --git a/tips.json b/tips.json index 788eedd..e155aa7 100644 --- a/tips.json +++ b/tips.json @@ -64,6 +64,10 @@ "title": "Undo local changes with the last content in head", "tip": "git checkout -- " }, + { + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" + }, { "title": "Changing a remote's URL", "tip": "git remote set-url origin " From 197d23a9b32e83cbd0bd1d09a1476b8fcbf14acd Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 29 Jul 2015 19:00:56 -0400 Subject: [PATCH 3/3] Describe how to see commits since forking from master The command in this tip avoids showing merge commits because sometimes developers will merge `master` into their feature branch in the course of development, especially when that feature is in development for a long time. This tip focuses on showing only those commits which introduce new changes and ignores those merge commits for this reason. It also displays the commits in reverse chronological order, oldest to newest, so that the output shows the development of a feature branch in "historical" order. 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 6f8ed1d..a4f0987 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ * [Stage parts of a changed file, instead of the entire file](https://github.com/git-tips/tips#stage-parts-of-a-changed-file-instead-of-the-entire-file) * [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion) * [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks) +* [See all commits made since forking from master](https://github.com/git-tips/tips#see-all-commits-made-since-forking-from-master) * [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick) * [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash) * [Git Aliases](https://github.com/git-tips/tips#git-aliases) @@ -177,6 +178,11 @@ curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completio git whatchanged --since='2 weeks ago' ``` +## See all commits made since forking from master +```sh +git log --no-merges --stat --reverse master.. +``` + ## Pick commits across branches using cherry-pick ```sh git checkout && cherry-pick diff --git a/tips.json b/tips.json index e155aa7..915520f 100644 --- a/tips.json +++ b/tips.json @@ -97,6 +97,10 @@ "title": "What changed since two weeks?", "tip": "git whatchanged --since='2 weeks ago'" }, + { + "title": "See all commits made since forking from master", + "tip": "git log --no-merges --stat --reverse master.." + }, { "title": "Pick commits across branches using cherry-pick", "tip": "git checkout && cherry-pick "