From dabba0095fbed05a5b2508f14f326e8f76391c3f Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Wed, 15 Jul 2015 19:09:15 +0530 Subject: [PATCH 001/251] s/clone/fork/g --- contributing.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contributing.md b/contributing.md index bdcd68b..62afd01 100644 --- a/contributing.md +++ b/contributing.md @@ -1,10 +1,7 @@ ## Easy steps: -* Clone this [repo](https://github.com/git-tips/tips.git): - ```sh - $ git clone https://github.com/git-tips/tips.git - ``` - +* [Fork](https://github.com/git-tips/tips/network) the repo. + * Install the deps: ```sh $ cd tips && npm install From 7db7aae79b59699ce8b399e484e86da85c64cf0a Mon Sep 17 00:00:00 2001 From: Anchal Date: Wed, 15 Jul 2015 20:00:26 +0530 Subject: [PATCH 002/251] tip for deleting a local or remote branch --- tips.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tips.json b/tips.json index 58eaa36..e9ac28b 100644 --- a/tips.json +++ b/tips.json @@ -34,11 +34,11 @@ { "title": "Track upstream branch", "tip": "git branch -u origin/mybranch" - } + }, { "title": "Delete local branch", "tip": "git branch -d local_branchname" - } + }, { "title": "Delete remote branch", "tip": "git push origin :remote_branchname" From acd8501b5f6346b8a9dfe2387bac4e8bac2d9734 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 15 Jul 2015 20:07:46 +0530 Subject: [PATCH 003/251] Updated readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 14dbb90..5a282e0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ * [Remove branches that have already been merged with master](https://github.com/git-tips/tips#Remove branches that have already been merged with master) * [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List all branches and their upstreams, as well as last commit on branch) * [Track upstream branch](https://github.com/git-tips/tips#Track upstream branch) +* [Delete local branch](https://github.com/git-tips/tips#Delete local branch) +* [Delete remote branch](https://github.com/git-tips/tips#Delete remote branch) @@ -64,5 +66,15 @@ git branch -vv git branch -u origin/mybranch ``` +## Delete local branch +```sh +git branch -d local_branchname +``` + +## Delete remote branch +```sh +git push origin :remote_branchname +``` + From 2bf7f0ea91fadd3f2de1567b90b1e01c1a8c4423 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 15 Jul 2015 20:16:49 +0530 Subject: [PATCH 004/251] dashified title to fix TOC. --- .doxie.render.toc.js | 2 +- README.md | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index a5cd205..356c332 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -3,7 +3,7 @@ var tips = require('./tips.json'); var render = function(data) { var data = data.data; - var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + data.title + ')\n'; + var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + data.title.split(' ').join('-') + ')\n'; if (tips[tips.length -1].title === data.title) out = out + '\n'; return out; diff --git a/README.md b/README.md index 5a282e0..bd67027 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,17 @@ -* [Overwrite pull](https://github.com/git-tips/tips#Overwrite pull) -* [List of all the files changed in a commit](https://github.com/git-tips/tips#List of all the files changed in a commit) -* [Git reset first commit](https://github.com/git-tips/tips#Git reset first commit) -* [List all the conflicted files](https://github.com/git-tips/tips#List all the conflicted files) -* [List all branches that are already merged into master](https://github.com/git-tips/tips#List all branches that are already merged into master) -* [Quickly switch to the previous branch](https://github.com/git-tips/tips#Quickly switch to the previous branch) -* [Remove branches that have already been merged with master](https://github.com/git-tips/tips#Remove branches that have already been merged with master) -* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List all branches and their upstreams, as well as last commit on branch) -* [Track upstream branch](https://github.com/git-tips/tips#Track upstream branch) -* [Delete local branch](https://github.com/git-tips/tips#Delete local branch) -* [Delete remote branch](https://github.com/git-tips/tips#Delete remote branch) +* [Overwrite pull](https://github.com/git-tips/tips#Overwrite-pull) +* [List of all the files changed in a commit](https://github.com/git-tips/tips#List-of-all-the-files-changed-in-a-commit) +* [Git reset first commit](https://github.com/git-tips/tips#Git-reset-first-commit) +* [List all the conflicted files](https://github.com/git-tips/tips#List-all-the-conflicted-files) +* [List all branches that are already merged into master](https://github.com/git-tips/tips#List-all-branches-that-are-already-merged-into-master) +* [Quickly switch to the previous branch](https://github.com/git-tips/tips#Quickly-switch-to-the-previous-branch) +* [Remove branches that have already been merged with master](https://github.com/git-tips/tips#Remove-branches-that-have-already-been-merged-with-master) +* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List-all-branches-and-their-upstreams,-as-well-as-last-commit-on-branch) +* [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch) +* [Delete local branch](https://github.com/git-tips/tips#Delete-local-branch) +* [Delete remote branch](https://github.com/git-tips/tips#Delete-remote-branch) From 6b5936ce5778564f6a5663ba1c143d1cbcbc7b58 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 15 Jul 2015 20:35:53 +0530 Subject: [PATCH 005/251] Slugified. --- .doxie.render.toc.js | 3 ++- README.md | 2 +- package.json | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index 356c332..ea4df5e 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -1,9 +1,10 @@ var tips = require('./tips.json'); +var slug = require('slug'); var render = function(data) { var data = data.data; - var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + data.title.split(' ').join('-') + ')\n'; + var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slug(data.title) + ')\n'; if (tips[tips.length -1].title === data.title) out = out + '\n'; return out; diff --git a/README.md b/README.md index bd67027..b56b16d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ * [List all branches that are already merged into master](https://github.com/git-tips/tips#List-all-branches-that-are-already-merged-into-master) * [Quickly switch to the previous branch](https://github.com/git-tips/tips#Quickly-switch-to-the-previous-branch) * [Remove branches that have already been merged with master](https://github.com/git-tips/tips#Remove-branches-that-have-already-been-merged-with-master) -* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List-all-branches-and-their-upstreams,-as-well-as-last-commit-on-branch) +* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) * [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch) * [Delete local branch](https://github.com/git-tips/tips#Delete-local-branch) * [Delete remote branch](https://github.com/git-tips/tips#Delete-remote-branch) diff --git a/package.json b/package.json index 158ea8a..64d7229 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,8 @@ "doxie.output": "^0.3.0", "doxie.render": "^0.3.0", "husky": "^0.8.1" + }, + "dependencies": { + "slug": "^0.9.1" } } From 695e7e19ba38e9ba5643d6a1ea16999c80e0c120 Mon Sep 17 00:00:00 2001 From: Anchal Date: Wed, 15 Jul 2015 22:56:22 +0530 Subject: [PATCH 006/251] undo local changes --- tips.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tips.json b/tips.json index e9ac28b..519396e 100644 --- a/tips.json +++ b/tips.json @@ -42,5 +42,9 @@ { "title": "Delete remote branch", "tip": "git push origin :remote_branchname" + }, + { + "title": "Undo local changes with the last content in head", + "tip": "git checkout -- file_name" } ] From 04573ea87de98d5f495de4ada9510d2a3bb65512 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 16 Jul 2015 09:07:15 +0530 Subject: [PATCH 007/251] Changing a remote's URL --- README.md | 16 ++++++++++++++-- tips.json | 10 +++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b56b16d..b76911f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ * [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch) * [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) +* [Changing a remote's URL](https://github.com/git-tips/tips#Changing-a-remotes-URL) @@ -68,12 +70,22 @@ git branch -u origin/mybranch ## Delete local branch ```sh -git branch -d local_branchname +git branch -d ``` ## Delete remote branch ```sh -git push origin :remote_branchname +git push origin : +``` + +## Undo local changes with the last content in head +```sh +git checkout -- +``` + +## Changing a remote's URL +```sh +git remote set-url origin ``` diff --git a/tips.json b/tips.json index 519396e..8f9d55b 100644 --- a/tips.json +++ b/tips.json @@ -37,14 +37,18 @@ }, { "title": "Delete local branch", - "tip": "git branch -d local_branchname" + "tip": "git branch -d " }, { "title": "Delete remote branch", - "tip": "git push origin :remote_branchname" + "tip": "git push origin :" }, { "title": "Undo local changes with the last content in head", - "tip": "git checkout -- file_name" + "tip": "git checkout -- " + }, + { + "title": "Changing a remote's URL", + "tip": "git remote set-url origin " } ] From abd2e497a24511714ecdcd20f21e60f18134fa08 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 16 Jul 2015 09:16:42 +0530 Subject: [PATCH 008/251] Doing away with slug dep --- .doxie.render.toc.js | 12 ++++++++++-- README.md | 26 +++++++++++++------------- package.json | 3 --- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index ea4df5e..97e2bb8 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -1,10 +1,18 @@ var tips = require('./tips.json'); -var slug = require('slug'); +// from https://gist.github.com/mathewbyrne/1280286 +slugify = function(text){ + return text.toString().toLowerCase() + .replace(/\s+/g, '-') // Replace spaces with - + .replace(/[^\w\-]+/g, '') // Remove all non-word chars + .replace(/\-\-+/g, '-') // Replace multiple - with single - + .replace(/^-+/, '') // Trim - from start of text + .replace(/-+$/, ''); // Trim - from end of text +} var render = function(data) { var data = data.data; - var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slug(data.title) + ')\n'; + var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slugify(data.title) + ')\n'; if (tips[tips.length -1].title === data.title) out = out + '\n'; return out; diff --git a/README.md b/README.md index b76911f..6d74c39 100644 --- a/README.md +++ b/README.md @@ -3,19 +3,19 @@ -* [Overwrite pull](https://github.com/git-tips/tips#Overwrite-pull) -* [List of all the files changed in a commit](https://github.com/git-tips/tips#List-of-all-the-files-changed-in-a-commit) -* [Git reset first commit](https://github.com/git-tips/tips#Git-reset-first-commit) -* [List all the conflicted files](https://github.com/git-tips/tips#List-all-the-conflicted-files) -* [List all branches that are already merged into master](https://github.com/git-tips/tips#List-all-branches-that-are-already-merged-into-master) -* [Quickly switch to the previous branch](https://github.com/git-tips/tips#Quickly-switch-to-the-previous-branch) -* [Remove branches that have already been merged with master](https://github.com/git-tips/tips#Remove-branches-that-have-already-been-merged-with-master) -* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#List-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) -* [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch) -* [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) -* [Changing a remote's URL](https://github.com/git-tips/tips#Changing-a-remotes-URL) +* [Overwrite pull](https://github.com/git-tips/tips#overwrite-pull) +* [List of all the files changed in a commit](https://github.com/git-tips/tips#list-of-all-the-files-changed-in-a-commit) +* [Git reset first commit](https://github.com/git-tips/tips#git-reset-first-commit) +* [List all the conflicted files](https://github.com/git-tips/tips#list-all-the-conflicted-files) +* [List all branches that are already merged into master](https://github.com/git-tips/tips#list-all-branches-that-are-already-merged-into-master) +* [Quickly switch to the previous branch](https://github.com/git-tips/tips#quickly-switch-to-the-previous-branch) +* [Remove branches that have already been merged with master](https://github.com/git-tips/tips#remove-branches-that-have-already-been-merged-with-master) +* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) +* [Track upstream branch](https://github.com/git-tips/tips#track-upstream-branch) +* [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) +* [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url) diff --git a/package.json b/package.json index 64d7229..158ea8a 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,5 @@ "doxie.output": "^0.3.0", "doxie.render": "^0.3.0", "husky": "^0.8.1" - }, - "dependencies": { - "slug": "^0.9.1" } } From e25227a25dbf4d30918ab27724050466d07e6cb2 Mon Sep 17 00:00:00 2001 From: Jon Maim Date: Thu, 16 Jul 2015 12:25:13 +0530 Subject: [PATCH 009/251] Update tips.json --- tips.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tips.json b/tips.json index 8f9d55b..ebeaba9 100644 --- a/tips.json +++ b/tips.json @@ -50,5 +50,9 @@ { "title": "Changing a remote's URL", "tip": "git remote set-url origin " + }, + { + "title": "Stage parts of a changed file, instead of the entire file", + "tip": "git add -p" } ] From 0cd100f768b38d135a7c7c552bb878bf845d170b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 16 Jul 2015 12:29:32 +0530 Subject: [PATCH 010/251] Stage parts of a changed file, tip --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6d74c39..af0fe14 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ * [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) * [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url) +* [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) @@ -88,5 +89,10 @@ git checkout -- git remote set-url origin ``` +## Stage parts of a changed file, instead of the entire file +```sh +git add -p +``` + From 3dcab1f843fa67a7ba43f0a9693ce4e3a7c8737b Mon Sep 17 00:00:00 2001 From: Anchal Date: Thu, 16 Jul 2015 17:39:38 +0530 Subject: [PATCH 011/251] list remote reference and get list of branches --- tips.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tips.json b/tips.json index ebeaba9..c839a05 100644 --- a/tips.json +++ b/tips.json @@ -51,6 +51,18 @@ "title": "Changing a remote's URL", "tip": "git remote set-url origin " }, + { + "title": "Get list of all remote references", + "tip": "git remote || git remote show" + }, + { + "title": "Get list of all local and remote branches", + "tip": "git branch -a" + }, + { + "title": "Get only remote branches", + "tip": "git branch -r" + }, { "title": "Stage parts of a changed file, instead of the entire file", "tip": "git add -p" From 6cfcc26d9f99ff87df62c3384a0e8762f7aed9a9 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 17 Jul 2015 06:51:14 +0530 Subject: [PATCH 012/251] Get git bash completion. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index af0fe14..25b245a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ * [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head) * [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url) * [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) @@ -94,5 +95,10 @@ git remote set-url origin git add -p ``` +## Get git bash completion +```sh +curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc +``` + diff --git a/tips.json b/tips.json index ebeaba9..f5ec05d 100644 --- a/tips.json +++ b/tips.json @@ -54,5 +54,9 @@ { "title": "Stage parts of a changed file, instead of the entire file", "tip": "git add -p" + }, + { + "title": "Get git bash completion", + "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" } ] From 9cc9a46519d37fba34122b42471309c495540008 Mon Sep 17 00:00:00 2001 From: Anchal Date: Fri, 17 Jul 2015 12:27:32 +0530 Subject: [PATCH 013/251] tried with alternatives --- README.md | 18 ++++++++++++++++++ tips.json | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 25b245a..ff2e852 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ * [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) * [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) +* [Get only remote branches](https://github.com/git-tips/tips#get-only-remote-branches) * [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) @@ -90,6 +93,21 @@ git checkout -- git remote set-url origin ``` +## Get list of all remote references +```sh +git remote +``` + +## Get list of all local and remote branches +```sh +git branch -a +``` + +## Get only remote branches +```sh +git branch -r +``` + ## Stage parts of a changed file, instead of the entire file ```sh git add -p diff --git a/tips.json b/tips.json index 5214a0e..2d3200f 100644 --- a/tips.json +++ b/tips.json @@ -53,7 +53,8 @@ }, { "title": "Get list of all remote references", - "tip": "git remote || git remote show" + "tip": "git remote", + "alternatives": "git remote show" }, { "title": "Get list of all local and remote branches", From 55778710eaf6661ec916984f3eb610268d4e95cf Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 17 Jul 2015 13:01:25 +0530 Subject: [PATCH 014/251] Support alternatives in tips. --- .doxie.render.js | 9 +++++++-- README.md | 6 ++++++ contributing.md | 7 ++++--- tips.json | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.doxie.render.js b/.doxie.render.js index ad9ac8b..82673fa 100644 --- a/.doxie.render.js +++ b/.doxie.render.js @@ -7,13 +7,18 @@ function escapeStr(str) { var render = function(data) { var data = data.data; - return [ + var tips = [ '## ' + data.title, '```sh', data.tip, '```', '\n' - ].join('\n'); + ]; + Array.isArray(data.alternatives) && tips.push(['__Alternatives:__']) && + data.alternatives.map(function(alternative){ + tips = tips.concat(['```sh',alternative,'```','\n']) + }); + return tips.join('\n'); }; module.exports = render; diff --git a/README.md b/README.md index ff2e852..2e47a92 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,12 @@ git remote set-url origin git remote ``` + +__Alternatives:__ +```sh +git remote show +``` + ## Get list of all local and remote branches ```sh git branch -a diff --git a/contributing.md b/contributing.md index 62afd01..a30ea54 100644 --- a/contributing.md +++ b/contributing.md @@ -2,17 +2,18 @@ * [Fork](https://github.com/git-tips/tips/network) the repo. -* Install the deps: +* Install the deps: ```sh $ cd tips && npm install ``` - + * Edit [tips.json](./tips.json) to add your tip in the below format: ```js { "title": , - "tip": + "tip": , + "alternatives": [Optional list of alternatives] } ``` diff --git a/tips.json b/tips.json index 2d3200f..d208786 100644 --- a/tips.json +++ b/tips.json @@ -54,7 +54,7 @@ { "title": "Get list of all remote references", "tip": "git remote", - "alternatives": "git remote show" + "alternatives": ["git remote show"] }, { "title": "Get list of all local and remote branches", From 85df5705fbe5dc721757634817a8aa25b820851a Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 22 Jul 2015 13:26:24 +0530 Subject: [PATCH 015/251] whatchanged --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 2e47a92..6fe057b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ * [Get only remote branches](https://github.com/git-tips/tips#get-only-remote-branches) * [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) @@ -124,5 +125,10 @@ git add -p curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` +## What changed since two weeks? +```sh +git whatchanged --since='2 weeks ago' +``` + diff --git a/tips.json b/tips.json index d208786..a4c7c06 100644 --- a/tips.json +++ b/tips.json @@ -71,5 +71,9 @@ { "title": "Get git bash completion", "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" + }, + { + "title": "What changed since two weeks?", + "tip": "git whatchanged --since='2 weeks ago'" } ] From e5f64df204503f274a31f20b553d5d88e4d5c1d7 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Wed, 22 Jul 2015 20:13:35 +0200 Subject: [PATCH 016/251] use doxie.append --- .doxie.render.toc.js | 2 -- package.json | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index 97e2bb8..92af283 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -1,4 +1,3 @@ -var tips = require('./tips.json'); // from https://gist.github.com/mathewbyrne/1280286 slugify = function(text){ return text.toString().toLowerCase() @@ -14,7 +13,6 @@ var render = function(data) { var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slugify(data.title) + ')\n'; - if (tips[tips.length -1].title === data.title) out = out + '\n'; return out; }; diff --git a/package.json b/package.json index 158ea8a..6d1b215 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "precommit": "npm run generate && git add README.md", "update-readme": "echo 'Updating the readme…'; doxie --render < ./tips.json --inject into README.md && echo '…done!'", - "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./tips.json --inject into README.md as toc && echo '…done!'", + "update-toc": "echo 'Updating the table of contents…'; doxie --render .doxie.render.toc.js < ./tips.json --append '\n' --inject into README.md as toc && echo '…done!'", "generate": "npm run update-readme; npm run update-toc" }, "repository": { @@ -29,6 +29,7 @@ "homepage": "https://github.com/git-tips/tips#readme", "devDependencies": { "doxie": "^0.2.2", + "doxie.append": "^0.1.0", "doxie.inject": "^0.1.1", "doxie.output": "^0.3.0", "doxie.render": "^0.3.0", From 7ecc00c50b7989de6f8fd6b23bbc3d15d38a8d9d Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Sat, 25 Jul 2015 15:22:52 +0530 Subject: [PATCH 017/251] Tips using git cherry-pick --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 6fe057b..6c7d6fc 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,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) +* [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick) @@ -130,5 +131,10 @@ curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completio git whatchanged --since='2 weeks ago' ``` +## Pick commits across branches using cherry-pick +```sh +git checkout && cherry-pick +``` + diff --git a/tips.json b/tips.json index a4c7c06..6dd2470 100644 --- a/tips.json +++ b/tips.json @@ -75,5 +75,9 @@ { "title": "What changed since two weeks?", "tip": "git whatchanged --since='2 weeks ago'" + }, + { + "title": "Pick commits across branches using cherry-pick", + "tip": "git checkout && cherry-pick " } ] From 7810dda14e315f0445e805ea765f35a2f92a12f0 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Sat, 25 Jul 2015 22:04:10 +0530 Subject: [PATCH 018/251] Clarification of git diff-tree and ls-tree --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c7d6fc..0ee8d02 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ * [Overwrite pull](https://github.com/git-tips/tips#overwrite-pull) -* [List of all the files changed in a commit](https://github.com/git-tips/tips#list-of-all-the-files-changed-in-a-commit) +* [List of all files changed in a commit](https://github.com/git-tips/tips#list-of-all-files-changed-in-a-commit) +* [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) * [List all the conflicted files](https://github.com/git-tips/tips#list-all-the-conflicted-files) * [List all branches that are already merged into master](https://github.com/git-tips/tips#list-all-branches-that-are-already-merged-into-master) @@ -35,7 +36,12 @@ git fetch --all && git reset --hard origin/master ``` -## List of all the files changed in a commit +## List of all files changed in a commit +```sh +git diff-tree --no-commit-id --name-only -r +``` + +## List of all files till a commit ```sh git ls-tree --name-only -r ``` diff --git a/tips.json b/tips.json index 6dd2470..79cd53c 100644 --- a/tips.json +++ b/tips.json @@ -4,7 +4,11 @@ "tip": "git fetch --all && git reset --hard origin/master" }, { - "title": "List of all the files changed in a commit", + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " + }, + { + "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " }, { From 8dda8b55e13df1229b36d02d2f507b4401fabbe9 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Sat, 25 Jul 2015 23:07:41 +0530 Subject: [PATCH 019/251] Find out branches containing a commit, including remote branches Alternative for local branches --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 0ee8d02..a231599 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ * [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) * [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) @@ -142,5 +143,16 @@ git whatchanged --since='2 weeks ago' git checkout && cherry-pick ``` +## Find out branches containing commit-hash +```sh +git branch -a --contains +``` + + +__Alternatives:__ +```sh +git branch --contains +``` + diff --git a/tips.json b/tips.json index 79cd53c..d6e6904 100644 --- a/tips.json +++ b/tips.json @@ -83,5 +83,10 @@ { "title": "Pick commits across branches using cherry-pick", "tip": "git checkout && cherry-pick " + }, + { + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] } ] From 3ed8741c28c56e509d7bf6873cd99589fcc2035f Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 27 Jul 2015 09:33:30 +0530 Subject: [PATCH 020/251] Git alias --- README.md | 7 +++++++ tips.json | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index a231599..2531761 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ * [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks) * [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) @@ -154,5 +155,11 @@ __Alternatives:__ git branch --contains ``` +## Git Aliases +```sh +git config --global alias. +git config --global alias.st status +``` + diff --git a/tips.json b/tips.json index d6e6904..1c87026 100644 --- a/tips.json +++ b/tips.json @@ -88,5 +88,9 @@ "title": "Find out branches containing commit-hash", "tip": "git branch -a --contains ", "alternatives": ["git branch --contains "] + }, + { + "title": "Git Aliases", + "tip": "git config --global alias. \ngit config --global alias.st status" } ] From efaba7db369b784b6c87e943ad1afe80048099ae Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Mon, 27 Jul 2015 22:10:57 +0530 Subject: [PATCH 021/251] Quite handy saving unfinished work Typo json --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ tips.json | 22 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/README.md b/README.md index 2531761..bd9412a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ * [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) +* [Saving current state of tracked files without commiting](https://github.com/git-tips/tips#saving-current-state-of-tracked-files-without-commiting) +* [Show list of all saved stashes](https://github.com/git-tips/tips#show-list-of-all-saved-stashes) +* [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) +* [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) +* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) @@ -161,5 +166,42 @@ git config --global alias. git config --global alias.st status ``` +## Saving current state of tracked files without commiting +```sh +git stash +``` + +## Show list of all saved stashes +```sh +git stash list +``` + +## Apply any stash without deleting from the stashed list +```sh +git stash apply +``` + +## Apply last stashed state and delete it from stashed list +```sh +git stash pop +``` + + +__Alternatives:__ +```sh +git stash apply stash@{0} && git stash drop stash@{0} +``` + +## Delete all stored stashes +```sh +git stash clear +``` + + +__Alternatives:__ +```sh +git stash drop +``` + diff --git a/tips.json b/tips.json index 1c87026..c6b3a69 100644 --- a/tips.json +++ b/tips.json @@ -92,5 +92,27 @@ { "title": "Git Aliases", "tip": "git config --global alias. \ngit config --global alias.st status" + }, + { + "title":"Saving current state of tracked files without commiting", + "tip": "git stash" + }, + { + "title":"Show list of all saved stashes", + "tip": "git stash list" + }, + { + "title": "Apply any stash without deleting from the stashed list", + "tip": "git stash apply " + }, + { + "title":"Apply last stashed state and delete it from stashed list", + "tip": "git stash pop", + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] + }, + { + "title": "Delete all stored stashes", + "tip": "git stash clear", + "alternatives": ["git stash drop "] } ] From 309397e0c9e86c939c3458416a69250f3f0a3de0 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Tue, 28 Jul 2015 22:08:59 +0530 Subject: [PATCH 022/251] git diff multiple usage --- README.md | 30 ++++++++++++++++++++++++------ tips.json | 20 ++++++++++++++++---- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index bd9412a..f2f856e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,13 @@ * [Overwrite pull](https://github.com/git-tips/tips#overwrite-pull) -* [List of all files changed in a commit](https://github.com/git-tips/tips#list-of-all-files-changed-in-a-commit) * [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) * [List all the conflicted files](https://github.com/git-tips/tips#list-all-the-conflicted-files) +* [List of all files changed in a commit](https://github.com/git-tips/tips#list-of-all-files-changed-in-a-commit) +* [Unstaged changes since last commit](https://github.com/git-tips/tips#unstaged-changes-since-last-commit) +* [Changes staged for commit](https://github.com/git-tips/tips#changes-staged-for-commit) +* [Show both staged and unstaged changes](https://github.com/git-tips/tips#show-both-staged-and-unstaged-changes) * [List all branches that are already merged into master](https://github.com/git-tips/tips#list-all-branches-that-are-already-merged-into-master) * [Quickly switch to the previous branch](https://github.com/git-tips/tips#quickly-switch-to-the-previous-branch) * [Remove branches that have already been merged with master](https://github.com/git-tips/tips#remove-branches-that-have-already-been-merged-with-master) @@ -43,11 +46,6 @@ git fetch --all && git reset --hard origin/master ``` -## List of all files changed in a commit -```sh -git diff-tree --no-commit-id --name-only -r -``` - ## List of all files till a commit ```sh git ls-tree --name-only -r @@ -63,6 +61,26 @@ git update-ref -d HEAD git diff --name-only --diff-filter=U ``` +## List of all files changed in a commit +```sh +git diff-tree --no-commit-id --name-only -r +``` + +## Unstaged changes since last commit +```sh +git diff +``` + +## Changes staged for commit +```sh +git diff --cached +``` + +## Show both staged and unstaged changes +```sh +git diff HEAD +``` + ## List all branches that are already merged into master ```sh git checkout master && git branch --merged diff --git a/tips.json b/tips.json index c6b3a69..681a19f 100644 --- a/tips.json +++ b/tips.json @@ -3,10 +3,6 @@ "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" }, - { - "title": "List of all files changed in a commit", - "tip": "git diff-tree --no-commit-id --name-only -r " - }, { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " @@ -19,6 +15,22 @@ "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" }, + { + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " + }, + { + "title":"Unstaged changes since last commit", + "tip":"git diff" + }, + { + "title":"Changes staged for commit", + "tip":"git diff --cached" + }, + { + "title":"Show both staged and unstaged changes", + "tip":"git diff HEAD" + }, { "title": "List all branches that are already merged into master", "tip": "git checkout master && git branch --merged" From 58a4b7cfd3eb8d1c01a52ee816e754762fa603a6 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Tue, 28 Jul 2015 22:27:12 +0530 Subject: [PATCH 023/251] git ls-files to show tracked and untracked files --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index f2f856e..a98cb4a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ * [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) * [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) @@ -221,5 +223,15 @@ __Alternatives:__ git stash drop ``` +## Show all tracked files +```sh +git ls-files -t +``` + +## Show all untracked files +```sh +git ls-files --others +``` + diff --git a/tips.json b/tips.json index 681a19f..f600b63 100644 --- a/tips.json +++ b/tips.json @@ -126,5 +126,13 @@ "title": "Delete all stored stashes", "tip": "git stash clear", "alternatives": ["git stash drop "] + }, + { + "title":"Show all tracked files", + "tip":"git ls-files -t" + }, + { + "title":"Show all untracked files", + "tip":"git ls-files --others" } ] From 8a26365c69f49278bfae4f4516c9ab157ff68c15 Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Tue, 28 Jul 2015 15:04:09 -0400 Subject: [PATCH 024/251] Add an easier-to-read way to delete a remote branch Since 2010 Git supports the `--delete` argument for git-push as an alias for the `:branch` syntax, i.e. these commands are equivalent: $ git push origin :foo $ git push origin --delete foo This patch changes the tip to use the `--delete` argument on the grounds that it is easier to remember, easier to understand, and easily available since it is unlikely for people to be using a version of Git which is more than five years old. Signed-off-by: Eric James Michael Ritz --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2531761..272cacc 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,12 @@ git branch -d ## Delete remote branch ```sh +git push origin --delete +``` + + +__Alternatives:__ +```sh git push origin : ``` diff --git a/tips.json b/tips.json index 1c87026..1e1fd13 100644 --- a/tips.json +++ b/tips.json @@ -45,7 +45,8 @@ }, { "title": "Delete remote branch", - "tip": "git push origin :" + "tip": "git push origin --delete ", + "alternatives": ["git push origin :"] }, { "title": "Undo local changes with the last content in head", 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 025/251] 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 026/251] 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 027/251] 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 " From de65ecb88612202978bc98f792df79d4f5d89ec7 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Fri, 31 Jul 2015 03:52:44 +0530 Subject: [PATCH 028/251] Help tips around git worktree one of git 2.5 features --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index a4f0987..6f39693 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ * [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) +* [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) +* [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) @@ -257,5 +259,15 @@ git ls-files --others git ls-files --others -i --exclude-standard ``` +## Create new working tree from a repository (git 2.5) +```sh +git worktree add -b +``` + +## Create new working tree from HEAD state +```sh +git worktree add --detach HEAD +``` + diff --git a/tips.json b/tips.json index 915520f..ff90d60 100644 --- a/tips.json +++ b/tips.json @@ -147,5 +147,13 @@ { "title": "Show all ignored files", "tip": "git ls-files --others -i --exclude-standard" + }, + { + "title": "Create new working tree from a repository (git 2.5)", + "tip":"git worktree add -b " + }, + { + "title": "Create new working tree from HEAD state", + "tip": "git worktree add --detach HEAD" } ] From 4cdc87f48e255749feb46b4f42133a672eebcfe3 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Fri, 31 Jul 2015 16:13:57 +0530 Subject: [PATCH 029/251] Using revert and reset --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 6f39693..e31f4b7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ * [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) +* [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit) +* [Resert: Discard commits, advised for private branch](https://github.com/git-tips/tips#resert-discard-commits-advised-for-private-branch) * [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) @@ -134,6 +136,16 @@ git push origin : git checkout -- ``` +## Revert: Undo a commit by creating a new commit +```sh +git revert +``` + +## Resert: Discard commits, advised for private branch +```sh +git reset +``` + ## Reword the previous commit message ```sh git commit -v --amend diff --git a/tips.json b/tips.json index ff90d60..e8b0739 100644 --- a/tips.json +++ b/tips.json @@ -64,6 +64,14 @@ "title": "Undo local changes with the last content in head", "tip": "git checkout -- " }, + { + "title":"Revert: Undo a commit by creating a new commit", + "tip":"git revert " + }, + { + "title":"Resert: Discard commits, advised for private branch", + "tip":"git reset " + }, { "title": "Reword the previous commit message", "tip": "git commit -v --amend" From a2319d70901ef01ead36dc0c478f3b0e669479a2 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Fri, 7 Aug 2015 06:27:15 +0530 Subject: [PATCH 030/251] git stash save -u which i started using --- README.md | 22 ++++++++++++++++++++-- tips.json | 10 ++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e31f4b7..535cae0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ * [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) * [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit) -* [Resert: Discard commits, advised for private branch](https://github.com/git-tips/tips#resert-discard-commits-advised-for-private-branch) +* [Reset: Discard commits, advised for private branch](https://github.com/git-tips/tips#reset-discard-commits-advised-for-private-branch) * [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) @@ -34,6 +34,7 @@ * [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) * [Saving current state of tracked files without commiting](https://github.com/git-tips/tips#saving-current-state-of-tracked-files-without-commiting) +* [Saving current state including untracked files](https://github.com/git-tips/tips#saving-current-state-including-untracked-files) * [Show list of all saved stashes](https://github.com/git-tips/tips#show-list-of-all-saved-stashes) * [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) @@ -141,7 +142,7 @@ git checkout -- git revert ``` -## Resert: Discard commits, advised for private branch +## Reset: Discard commits, advised for private branch ```sh git reset ``` @@ -224,6 +225,23 @@ git config --global alias.st status git stash ``` + +__Alternatives:__ +```sh +git stash save +``` + +## Saving current state including untracked files +```sh +git stash save -u +``` + + +__Alternatives:__ +```sh +git stash save --include-untracked +``` + ## Show list of all saved stashes ```sh git stash list diff --git a/tips.json b/tips.json index e8b0739..ef8d003 100644 --- a/tips.json +++ b/tips.json @@ -69,7 +69,7 @@ "tip":"git revert " }, { - "title":"Resert: Discard commits, advised for private branch", + "title":"Reset: Discard commits, advised for private branch", "tip":"git reset " }, { @@ -124,7 +124,13 @@ }, { "title":"Saving current state of tracked files without commiting", - "tip": "git stash" + "tip": "git stash", + "alternatives": ["git stash save"] + }, + { + "title":"Saving current state including untracked files", + "tip": "git stash save -u", + "alternatives": ["git stash save --include-untracked"] }, { "title":"Show list of all saved stashes", From fd7f20a3952656d930df9de35414e2f6ee331ac5 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:41:10 +0530 Subject: [PATCH 031/251] clean untracked files and directory --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 535cae0..312d0fb 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) * [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) * [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) +* [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) +* [Forcefully remove unstracted directory](https://github.com/git-tips/tips#forcefully-remove-unstracted-directory) @@ -299,5 +301,15 @@ git worktree add -b git worktree add --detach HEAD ``` +## Forcefully remove untracked files +```sh +git clean -f +``` + +## Forcefully remove unstracted directory +```sh +git clean -f -d +``` + diff --git a/tips.json b/tips.json index ef8d003..4594d8c 100644 --- a/tips.json +++ b/tips.json @@ -169,5 +169,13 @@ { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" + }, + { + "title": "Forcefully remove untracked files", + "tip": "git clean -f" + }, + { + "title": "Forcefully remove unstracted directory", + "tip": "git clean -f -d" } ] From d74c78a473d9d2c42398b7c9cb5c27b2aa0ce8d9 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:47:49 +0530 Subject: [PATCH 032/251] get list of untracked files/directory --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 312d0fb..26e2fe8 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,9 @@ * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) * [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) * [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) +* [Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-untracked-filesdirectory) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) -* [Forcefully remove unstracted directory](https://github.com/git-tips/tips#forcefully-remove-unstracted-directory) +* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) @@ -301,12 +302,17 @@ git worktree add -b git worktree add --detach HEAD ``` +## Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory +```sh +git clean -n +``` + ## Forcefully remove untracked files ```sh git clean -f ``` -## Forcefully remove unstracted directory +## Forcefully remove untracked directory ```sh git clean -f -d ``` diff --git a/tips.json b/tips.json index 4594d8c..7bfb4aa 100644 --- a/tips.json +++ b/tips.json @@ -170,12 +170,16 @@ "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" }, + { + "title": "Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory", + "tip": "git clean -n" + }, { "title": "Forcefully remove untracked files", "tip": "git clean -f" }, { - "title": "Forcefully remove unstracted directory", + "title": "Forcefully remove untracked directory", "tip": "git clean -f -d" } ] From 9ac4b5be057ac2b7c06dcf281c07c3101986d81b Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:48:14 +0530 Subject: [PATCH 033/251] get list of untracked files/directory --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 26e2fe8..138fe60 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) * [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) * [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) -* [Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-untracked-filesdirectory) +* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) @@ -302,7 +302,7 @@ git worktree add -b git worktree add --detach HEAD ``` -## Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory +## Before deleting untracked files/directory, do a dry run to get the list of these files/directories ```sh git clean -n ``` diff --git a/tips.json b/tips.json index 7bfb4aa..3f4034e 100644 --- a/tips.json +++ b/tips.json @@ -171,7 +171,7 @@ "tip": "git worktree add --detach HEAD" }, { - "title": "Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory", + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" }, { From 5da7631c2370528a27aad6a8672175ab6917764c Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 12:18:39 +0530 Subject: [PATCH 034/251] alternative for cleaning untracked directory --- tips.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 3f4034e..843d513 100644 --- a/tips.json +++ b/tips.json @@ -180,6 +180,7 @@ }, { "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d" + "tip": "git clean -f -d", + "alternatives": "git clean -df" } ] From f7ac6d21b6f857c128f2a9478b5b6a9dde62c209 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 12:19:37 +0530 Subject: [PATCH 035/251] alternative for cleaning untracked directory --- README.md | 6 ++++++ tips.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 138fe60..0206762 100644 --- a/README.md +++ b/README.md @@ -317,5 +317,11 @@ git clean -f git clean -f -d ``` + +__Alternatives:__ +```sh +git clean -df +``` + diff --git a/tips.json b/tips.json index 843d513..f9dd009 100644 --- a/tips.json +++ b/tips.json @@ -181,6 +181,6 @@ { "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", - "alternatives": "git clean -df" + "alternatives": ["git clean -df"] } ] From a0f2f10ec945e401b73bf59004f2bb925455f352 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 12 Aug 2015 20:55:36 +0530 Subject: [PATCH 036/251] update all submodules. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 0206762..95cb2b7 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ * [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) +* [Update all the submoudles](https://github.com/git-tips/tips#update-all-the-submoudles) @@ -323,5 +324,10 @@ __Alternatives:__ git clean -df ``` +## Update all the submoudles +```sh +git submodule foreach git pull +``` + diff --git a/tips.json b/tips.json index f9dd009..7c2e432 100644 --- a/tips.json +++ b/tips.json @@ -182,5 +182,9 @@ "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", "alternatives": ["git clean -df"] + }, + { + "title": "Update all the submoudles", + "tip": "git submodule foreach git pull" } ] From 2c82081aed55114231882714cb33d3c114bd2d8b Mon Sep 17 00:00:00 2001 From: Samuel Chase Date: Fri, 14 Aug 2015 10:36:46 +0530 Subject: [PATCH 037/251] Fix shell command and spelling --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 95cb2b7..42c1ff6 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,7 @@ git log --no-merges --stat --reverse master.. ## Pick commits across branches using cherry-pick ```sh -git checkout && cherry-pick +git checkout && git cherry-pick ``` ## Find out branches containing commit-hash @@ -324,7 +324,7 @@ __Alternatives:__ git clean -df ``` -## Update all the submoudles +## Update all the submodules ```sh git submodule foreach git pull ``` From 740e817be7485e508bc654d5fa225c14fe39aa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s=20Paronella?= Date: Sat, 15 Aug 2015 14:09:42 +0200 Subject: [PATCH 038/251] Fix typo Fix #25 --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 7c2e432..e9490ec 100644 --- a/tips.json +++ b/tips.json @@ -184,7 +184,7 @@ "alternatives": ["git clean -df"] }, { - "title": "Update all the submoudles", + "title": "Update all the submodules", "tip": "git submodule foreach git pull" } ] From 548f59900c7dc370d4628b1334cd67bddf1b3b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s=20Paronella?= Date: Sat, 15 Aug 2015 14:12:24 +0200 Subject: [PATCH 039/251] Fix Typo fix typo from #25 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42c1ff6..4eb758c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ * [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) -* [Update all the submoudles](https://github.com/git-tips/tips#update-all-the-submoudles) +* [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) From 3048cfb182678c35c38b5f7dce6298ca27911fb1 Mon Sep 17 00:00:00 2001 From: Pratyush Date: Mon, 17 Aug 2015 00:48:33 +0530 Subject: [PATCH 040/251] add git cherry tip --- README.md | 14 +++++++++++++- tips.json | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4eb758c..e4ec12e 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) * [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) +* [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) @@ -204,7 +205,7 @@ git log --no-merges --stat --reverse master.. ## Pick commits across branches using cherry-pick ```sh -git checkout && git cherry-pick +git checkout && cherry-pick ``` ## Find out branches containing commit-hash @@ -329,5 +330,16 @@ git clean -df git submodule foreach git pull ``` +## Show all commits in the current branch yet to be merged to master +```sh +git cherry -v master +``` + + +__Alternatives:__ +```sh +git cherry -v master +``` + diff --git a/tips.json b/tips.json index e9490ec..8afe58e 100644 --- a/tips.json +++ b/tips.json @@ -186,5 +186,10 @@ { "title": "Update all the submodules", "tip": "git submodule foreach git pull" + }, + { + "title": "Show all commits in the current branch yet to be merged to master", + "tip": "git cherry -v master", + "alternatives": ["git cherry -v master "] } ] From 274f663e6bfe75fead1377f46cae2c623f2536f3 Mon Sep 17 00:00:00 2001 From: Pratyush Date: Wed, 19 Aug 2015 14:59:29 +0530 Subject: [PATCH 041/251] tip to rename a branch --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index e4ec12e..764adb7 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) * [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) * [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) +* [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) @@ -341,5 +342,16 @@ __Alternatives:__ git cherry -v master ``` +## Rename a branch +```sh +git branch -m +``` + + +__Alternatives:__ +```sh +git branch -m [] +``` + diff --git a/tips.json b/tips.json index 8afe58e..fc11b11 100644 --- a/tips.json +++ b/tips.json @@ -191,5 +191,10 @@ "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", "alternatives": ["git cherry -v master "] + }, + { + "title": "Rename a branch", + "tip": "git branch -m ", + "alternatives": ["git branch -m [] "] } ] From 5d57c4f132cd703ada0ce5c575532db4a56bf3dc Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 21 Aug 2015 19:34:59 +0530 Subject: [PATCH 042/251] rebases and merge feature branch to master. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 764adb7..9876098 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ * [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) * [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) * [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) +* [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) @@ -353,5 +354,10 @@ __Alternatives:__ git branch -m [] ``` +## rebases 'feature' to 'master' and merges it in to master +```sh +git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} +``` + diff --git a/tips.json b/tips.json index fc11b11..661847e 100644 --- a/tips.json +++ b/tips.json @@ -196,5 +196,9 @@ "title": "Rename a branch", "tip": "git branch -m ", "alternatives": ["git branch -m [] "] + }, + { + "title": "rebases 'feature' to 'master' and merges it in to master ", + "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" } ] From 5c85e367701f4efea8a23fc2d994521da4fbcc0d Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 22 Aug 2015 18:25:04 +0530 Subject: [PATCH 043/251] Archive a branch. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 9876098..b8ee675 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ * [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) * [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) * [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) +* [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) @@ -359,5 +360,10 @@ git branch -m [] git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} ``` +## Archive the `master` branch +```sh +git archive master --format=zip --output=master.zip +``` + diff --git a/tips.json b/tips.json index 661847e..07dabae 100644 --- a/tips.json +++ b/tips.json @@ -200,5 +200,9 @@ { "title": "rebases 'feature' to 'master' and merges it in to master ", "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" + }, + { + "title": "Archive the `master` branch", + "tip": "git archive master --format=zip --output=master.zip" } ] From 97ea96885adc74f6fc12e99f8d8b7def96d91a62 Mon Sep 17 00:00:00 2001 From: Pratyush Date: Sat, 22 Aug 2015 19:20:06 +0530 Subject: [PATCH 044/251] tip to amend last commit --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b8ee675..8b2a72a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ * [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) * [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) +* [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) @@ -365,5 +366,10 @@ git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1 git archive master --format=zip --output=master.zip ``` +## Modify previous commit without modifying the commit message +```sh +git add --all && git commit --amend --no-edit +``` + diff --git a/tips.json b/tips.json index 07dabae..ca9983f 100644 --- a/tips.json +++ b/tips.json @@ -204,5 +204,9 @@ { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" + }, + { + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" } ] From 435fc517036a2d3610bc0c04d0bdf3aa929850f8 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Tue, 25 Aug 2015 18:39:20 +0530 Subject: [PATCH 045/251] Prune origin. --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 8b2a72a..b968ab2 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ * [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) * [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) +* [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) @@ -371,5 +372,16 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` +## Purnes branches that have been deleted in the remote. +```sh +git fetch -p +``` + + +__Alternatives:__ +```sh +git remote prune origin +``` + diff --git a/tips.json b/tips.json index ca9983f..8f909b2 100644 --- a/tips.json +++ b/tips.json @@ -208,5 +208,10 @@ { "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" + }, + { + "title": "Purnes branches that have been deleted in the remote.", + "tip": "git fetch -p", + "alternatives":["git remote prune origin"] } ] From ca58c81f634296e74ee61c17b055aed6462e2b31 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 26 Aug 2015 16:34:50 +0530 Subject: [PATCH 046/251] LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..be0215a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Hemanth.HM + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From e9e75fed9e1dfc07c914a2d7a960165f82db5ef4 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 28 Aug 2015 18:17:40 +0530 Subject: [PATCH 047/251] commit hash of the initial revision --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b968ab2..e922e68 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) * [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) * [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) +* [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) @@ -383,5 +384,10 @@ __Alternatives:__ git remote prune origin ``` +## Retrieve the commit hash of the initial revision. +```sh + git rev-list --reverse HEAD | head -1 +``` + diff --git a/tips.json b/tips.json index 8f909b2..377c461 100644 --- a/tips.json +++ b/tips.json @@ -213,5 +213,9 @@ "title": "Purnes branches that have been deleted in the remote.", "tip": "git fetch -p", "alternatives":["git remote prune origin"] + }, + { + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1" } ] From 8746905b37a5e19906ec4ce9a01b7a68ca605034 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 30 Aug 2015 20:32:40 +0530 Subject: [PATCH 048/251] Visualize the version tree. --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index e922e68..9caba91 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ * [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) * [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) +* [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) @@ -389,5 +390,16 @@ git remote prune origin git rev-list --reverse HEAD | head -1 ``` +## Visualize the version tree. +```sh +git log --pretty=oneline --graph --decorate --all +``` + + +__Alternatives:__ +```sh +gitk --all +``` + diff --git a/tips.json b/tips.json index 377c461..c19b40b 100644 --- a/tips.json +++ b/tips.json @@ -217,5 +217,10 @@ { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1" + }, + { + "title": "Visualize the version tree.", + "tip": "git log --pretty=oneline --graph --decorate --all", + "alternatives":["gitk --all"] } ] From 061d6ba4bb8d52c58bdee080d7d747b4d6be1d78 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 2 Sep 2015 19:38:07 +0530 Subject: [PATCH 049/251] Deploying git tracked subfolder to gh-pages --- README.md | 6 ++++++ tips.json | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 9caba91..eb2df77 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ * [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) +* [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) @@ -401,5 +402,10 @@ __Alternatives:__ gitk --all ``` +## Deploying git tracked subfolder to gh-pages +```sh +git subtree push --prefix subfolder_name origin gh-pages +``` + diff --git a/tips.json b/tips.json index c19b40b..33b34f3 100644 --- a/tips.json +++ b/tips.json @@ -222,5 +222,10 @@ "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", "alternatives":["gitk --all"] + }, + { + "title": "Deploying git tracked subfolder to gh-pages", + "tip": "git subtree push --prefix subfolder_name origin gh-pages", + "alternatives": "git subtree push --prefix subfolder_name origin branch_name" } ] From b31618b9750be78973b6dba75f2f79e39bc3c80e Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 2 Sep 2015 19:58:41 +0530 Subject: [PATCH 050/251] Adding a project to repo using subtree --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index eb2df77..a34b6c0 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) +* [Adding a project to repo using subtree. Lets say we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-lets-say-we-are-adding-in-vendor-directory) @@ -407,5 +408,10 @@ gitk --all git subtree push --prefix subfolder_name origin gh-pages ``` +## Adding a project to repo using subtree. Lets say we are adding in vendor directory +```sh +git subtree add --prefix=vendor/ --squash git@github.com:/.git master +``` + diff --git a/tips.json b/tips.json index 33b34f3..41177f9 100644 --- a/tips.json +++ b/tips.json @@ -227,5 +227,9 @@ "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", "alternatives": "git subtree push --prefix subfolder_name origin branch_name" + }, + { + "title": "Adding a project to repo using subtree. Lets say we are adding in vendor directory", + "tip": "git subtree add --prefix=vendor/ --squash git@github.com:/.git master" } ] From 8e7386807595e7f464cbe623d7ff99db04f58d34 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 2 Sep 2015 20:10:26 +0530 Subject: [PATCH 051/251] pull changes of subproject using git subtree --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a34b6c0..e7a72eb 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,8 @@ * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) -* [Adding a project to repo using subtree. Lets say we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-lets-say-we-are-adding-in-vendor-directory) +* [Adding a project to repo using subtree. For example we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-for-example-we-are-adding-in-vendor-directory) +* [Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-subproject-using-subtree-for-example-we-have-the-subproject-in-vendor-directory) @@ -408,10 +409,15 @@ gitk --all git subtree push --prefix subfolder_name origin gh-pages ``` -## Adding a project to repo using subtree. Lets say we are adding in vendor directory +## Adding a project to repo using subtree. For example we are adding in vendor directory ```sh git subtree add --prefix=vendor/ --squash git@github.com:/.git master ``` +## Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory +```sh +git subtree pull --prefix=vendor/ --squash git@github.com:/.git master +``` + diff --git a/tips.json b/tips.json index 41177f9..c330dbc 100644 --- a/tips.json +++ b/tips.json @@ -229,7 +229,11 @@ "alternatives": "git subtree push --prefix subfolder_name origin branch_name" }, { - "title": "Adding a project to repo using subtree. Lets say we are adding in vendor directory", + "title": "Adding a project to repo using subtree. For example we are adding in vendor directory", "tip": "git subtree add --prefix=vendor/ --squash git@github.com:/.git master" + }, + { + "title": "Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory", + "tip": "git subtree pull --prefix=vendor/ --squash git@github.com:/.git master" } ] From 1f08b126685e609452047e6f6a6b69d97c29cdfe Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 2 Sep 2015 20:21:18 +0530 Subject: [PATCH 052/251] Updated title text --- README.md | 12 ++++++------ tips.json | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e7a72eb..09c339e 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) -* [Adding a project to repo using subtree. For example we are adding in vendor directory](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree-for-example-we-are-adding-in-vendor-directory) -* [Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-subproject-using-subtree-for-example-we-have-the-subproject-in-vendor-directory) +* [Adding a project to repo using subtree](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree) +* [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) @@ -409,14 +409,14 @@ gitk --all git subtree push --prefix subfolder_name origin gh-pages ``` -## Adding a project to repo using subtree. For example we are adding in vendor directory +## Adding a project to repo using subtree ```sh -git subtree add --prefix=vendor/ --squash git@github.com:/.git master +git subtree add --prefix=/ --squash git@github.com:/.git master ``` -## Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory +## Get latest changes in your repo for a linked project using subtree ```sh -git subtree pull --prefix=vendor/ --squash git@github.com:/.git master +git subtree pull --prefix=/ --squash git@github.com:/.git master ``` diff --git a/tips.json b/tips.json index c330dbc..6dbc437 100644 --- a/tips.json +++ b/tips.json @@ -229,11 +229,11 @@ "alternatives": "git subtree push --prefix subfolder_name origin branch_name" }, { - "title": "Adding a project to repo using subtree. For example we are adding in vendor directory", - "tip": "git subtree add --prefix=vendor/ --squash git@github.com:/.git master" + "title": "Adding a project to repo using subtree", + "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" }, { - "title": "Get latest changes in your repo for a linked subproject using subtree. For example we have the subproject in vendor directory", - "tip": "git subtree pull --prefix=vendor/ --squash git@github.com:/.git master" + "title": "Get latest changes in your repo for a linked project using subtree", + "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" } ] From ebd7521a49eb040a357e19fa9eee321773560607 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 13 Sep 2015 21:22:57 +0530 Subject: [PATCH 053/251] git bundle --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 09c339e..a62c64f 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) * [Adding a project to repo using subtree](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree) * [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) +* [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) @@ -419,5 +420,10 @@ git subtree add --prefix=/ --squash git@github.com git subtree pull --prefix=/ --squash git@github.com:/.git master ``` +## Export a branch with history to the a file. +```sh +git bundle create +``` + diff --git a/tips.json b/tips.json index 6dbc437..a30f50d 100644 --- a/tips.json +++ b/tips.json @@ -235,5 +235,9 @@ { "title": "Get latest changes in your repo for a linked project using subtree", "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" + }, + { + "title": "Export a branch with history to the a file.", + "tip": "git bundle create " } ] From c0faf65fc98a4e834cc64fb6eb9befc3d446cbad Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 13 Sep 2015 21:25:07 +0530 Subject: [PATCH 054/251] Import form a bundle --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index a62c64f..36cce35 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ * [Adding a project to repo using subtree](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree) * [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) * [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) +* [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle) @@ -425,5 +426,10 @@ git subtree pull --prefix=/ --squash git@github.co git bundle create ``` +## Import form a bundle +```sh +git clone repo.bundle -b +``` + diff --git a/tips.json b/tips.json index a30f50d..0e076de 100644 --- a/tips.json +++ b/tips.json @@ -239,5 +239,9 @@ { "title": "Export a branch with history to the a file.", "tip": "git bundle create " + }, + { + "title": "Import form a bundle", + "tip": "git clone repo.bundle -b " } ] From affd2f840a8c814b2f8597877399a018bae52647 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 19 Sep 2015 17:59:32 +0530 Subject: [PATCH 055/251] Get the name of the current branch --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 36cce35..253fcaf 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ * [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) * [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) * [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle) +* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch) @@ -431,5 +432,10 @@ git bundle create git clone repo.bundle -b ``` +## Get the name of current branch. +```sh +git rev-parse --abbrev-ref HEAD +``` + diff --git a/tips.json b/tips.json index 0e076de..02ccfdc 100644 --- a/tips.json +++ b/tips.json @@ -243,5 +243,9 @@ { "title": "Import form a bundle", "tip": "git clone repo.bundle -b " + }, + { + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" } ] From 3b8df89962059e30490fd1837ea2bce71a3c3651 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 20 Sep 2015 18:52:48 +0000 Subject: [PATCH 056/251] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 253fcaf..99d7a0a 100644 --- a/README.md +++ b/README.md @@ -380,7 +380,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Purnes branches that have been deleted in the remote. +## Prunes branches that have been deleted in the remote. ```sh git fetch -p ``` From 31ce22adac93aa245207e24c1f97e06d96c9f0a2 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Tue, 29 Sep 2015 09:43:53 +0200 Subject: [PATCH 057/251] ignore a file --- README.md | 8 +++++++- tips.json | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99d7a0a..513693b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ * [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) * [Import form a bundle](https://github.com/git-tips/tips#import-form-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) @@ -380,7 +381,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Prunes branches that have been deleted in the remote. +## Purnes branches that have been deleted in the remote. ```sh git fetch -p ``` @@ -437,5 +438,10 @@ git clone repo.bundle -b git rev-parse --abbrev-ref HEAD ``` +## Ignore one file on commit (e.g. Changelog). +```sh +git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog +``` + diff --git a/tips.json b/tips.json index 02ccfdc..6d459d1 100644 --- a/tips.json +++ b/tips.json @@ -247,5 +247,9 @@ { "title": "Get the name of current branch.", "tip": "git rev-parse --abbrev-ref HEAD" + }, + { + "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" } ] From 47a525a5349daf4e18fbf6a7b5206806398962b4 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 29 Sep 2015 12:37:17 +0200 Subject: [PATCH 058/251] Purnes -> Prunes --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 513693b..d7e2b00 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ * [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) * [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) -* [Purnes branches that have been deleted in the remote.](https://github.com/git-tips/tips#purnes-branches-that-have-been-deleted-in-the-remote) +* [Prunes branches that have been deleted in the remote.](https://github.com/git-tips/tips#prunes-branches-that-have-been-deleted-in-the-remote) * [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) * [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) @@ -381,7 +381,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Purnes branches that have been deleted in the remote. +## Prunes branches that have been deleted in the remote. ```sh git fetch -p ``` diff --git a/tips.json b/tips.json index 6d459d1..d796ff4 100644 --- a/tips.json +++ b/tips.json @@ -210,7 +210,7 @@ "tip": "git add --all && git commit --amend --no-edit" }, { - "title": "Purnes branches that have been deleted in the remote.", + "title": "Prunes branches that have been deleted in the remote.", "tip": "git fetch -p", "alternatives":["git remote prune origin"] }, From af16b3c8eb6e44513f39399cceca11000d7d08d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Aubin?= Date: Fri, 9 Oct 2015 14:28:19 +0200 Subject: [PATCH 059/251] Typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit form → from --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7e2b00..03fedce 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ * [Adding a project to repo using subtree](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree) * [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) * [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) -* [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle) +* [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) @@ -428,7 +428,7 @@ git subtree pull --prefix=/ --squash git@github.co git bundle create ``` -## Import form a bundle +## Import from a bundle ```sh git clone repo.bundle -b ``` 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 060/251] 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 061/251] 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" } ] From f89a062f722820a5d6a5617f56649e650d188c19 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 28 Oct 2015 16:24:02 +0530 Subject: [PATCH 062/251] Fetch PR by ID to a local branch --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index edd9746..39cf0b3 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ * [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) +* [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch) @@ -455,5 +456,16 @@ git update-index --assume-unchanged Changelog; git commit -a; git update-index - git rebase --autostash ``` +## Fetch pull request by ID to a local branch +```sh +git fetch origin pull//head: +``` + + +__Alternatives:__ +```sh +git pull origin pull//head: +``` + diff --git a/tips.json b/tips.json index e3abadc..3f445ba 100644 --- a/tips.json +++ b/tips.json @@ -259,5 +259,10 @@ { "title": "Stash changes before rebasing", "tip": "git rebase --autostash" + }, + { + "title": "Fetch pull request by ID to a local branch", + "tip": "git fetch origin pull//head:", + "alternatives": ["git pull origin pull//head:"] } ] From 7fdd7304d0ec34705117bf86bdaacda82b83cd5f Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Mon, 2 Nov 2015 22:00:16 -0500 Subject: [PATCH 063/251] Add a tip to show the most recent tag This tip shows how to display the most recent tag reachable on the current branch. The use of `--abbrev=0` is necessary otherwise the output would contain additional information (specifically part of a commit hash), appended to the tag name. It's worth noting that this command is usable for branches other than the current one, e.g. $ git describe --tags --abbrev=0 master That would show the most recent tag on the `master` branch regardless of whatever branch the user is currently on. 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 39cf0b3..0bce4e9 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ * [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) * [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch) +* [Show the most recent tag on the current branch](https://github.com/git-tips/tips#show-the-most-recent-tag-on-the-current-branch) @@ -467,5 +468,10 @@ __Alternatives:__ git pull origin pull//head: ``` +## Show the most recent tag on the current branch +```sh +git describe --tags --abbrev=0 +``` + diff --git a/tips.json b/tips.json index 3f445ba..72c2075 100644 --- a/tips.json +++ b/tips.json @@ -264,5 +264,9 @@ "title": "Fetch pull request by ID to a local branch", "tip": "git fetch origin pull//head:", "alternatives": ["git pull origin pull//head:"] + }, + { + "title": "Show the most recent tag on the current branch", + "tip": "git describe --tags --abbrev=0" } ] From d80c4ed36cff6330f17c482df4f6391317081463 Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Tue, 17 Nov 2015 21:20:38 -0500 Subject: [PATCH 064/251] Show how to read guides that come with Git This patch adds a tip explaining `git help -g`. That command will list a collection of useful guides that come "pre-built" with Git, e.g. `git help workflows` and `git help revisions`. These are useful resources for learning and looking-up common Git concepts and techniques, and that broad usefulness is the justification for placing the tip near the very top of the list. 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 0bce4e9..985c95b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ * [Everyday Git in twenty commands or so](https://github.com/git-tips/tips#everyday-git-in-twenty-commands-or-so) +* [Show helpful guides that come with Git](https://github.com/git-tips/tips#show-helpful-guides-that-come-with-git) * [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) @@ -79,6 +80,11 @@ git help everyday ``` +## Show helpful guides that come with Git +```sh +git help -g +``` + ## Overwrite pull ```sh git fetch --all && git reset --hard origin/master diff --git a/tips.json b/tips.json index 72c2075..c2bb659 100644 --- a/tips.json +++ b/tips.json @@ -3,6 +3,10 @@ "title": "Everyday Git in twenty commands or so", "tip": "git help everyday" }, + { + "title": "Show helpful guides that come with Git", + "tip": "git help -g" + }, { "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" From 7f3f56c62ecc9568789f049ec37c7f825b50b009 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 18 Dec 2015 20:56:55 +0530 Subject: [PATCH 065/251] inline word diff --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 985c95b..269bfd7 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ * [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) * [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch) -* [Show the most recent tag on the current branch](https://github.com/git-tips/tips#show-the-most-recent-tag-on-the-current-branch) +* [Show the most recent tag on the current branch.](https://github.com/git-tips/tips#show-the-most-recent-tag-on-the-current-branch) +* [Show inline word diff.](https://github.com/git-tips/tips#show-inline-word-diff) @@ -474,10 +475,15 @@ __Alternatives:__ git pull origin pull//head: ``` -## Show the most recent tag on the current branch +## Show the most recent tag on the current branch. ```sh git describe --tags --abbrev=0 ``` +## Show inline word diff. +```sh +git diff --word-diff +``` + diff --git a/tips.json b/tips.json index c2bb659..c708777 100644 --- a/tips.json +++ b/tips.json @@ -270,7 +270,11 @@ "alternatives": ["git pull origin pull//head:"] }, { - "title": "Show the most recent tag on the current branch", + "title": "Show the most recent tag on the current branch.", "tip": "git describe --tags --abbrev=0" + }, + { + "title": "Show inline word diff.", + "tip": "git diff --word-diff" } ] From 6197057dc724d98a97a031337bd33bf3ec3f8e86 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 19 Dec 2015 22:25:07 +0530 Subject: [PATCH 066/251] --assume-unchanged and no--assume-unchanged --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 269bfd7..259aca9 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ * [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch) * [Show the most recent tag on the current branch.](https://github.com/git-tips/tips#show-the-most-recent-tag-on-the-current-branch) * [Show inline word diff.](https://github.com/git-tips/tips#show-inline-word-diff) +* [Don’t consider changes for tracked file.](https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file) +* [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) @@ -485,5 +487,15 @@ git describe --tags --abbrev=0 git diff --word-diff ``` +## Don’t consider changes for tracked file. +```sh +git update-index --assume-unchanged +``` + +## Undo assume-unchanged. +```sh +git update-index --no-assume-unchanged +``` + diff --git a/tips.json b/tips.json index c708777..80be09e 100644 --- a/tips.json +++ b/tips.json @@ -276,5 +276,13 @@ { "title": "Show inline word diff.", "tip": "git diff --word-diff" + }, + { + "title": "Don’t consider changes for tracked file.", + "tip": "git update-index --assume-unchanged " + }, + { + "title": "Undo assume-unchanged.", + "tip": "git update-index --no-assume-unchanged " } ] From 8181a37dd1998592d74158ef39aacf3ebb0392de Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 21 Dec 2015 19:25:46 +0530 Subject: [PATCH 067/251] clean files from .gitignore --- README.md | 6 + tips.json | 576 +++++++++++++++++++++++++++--------------------------- 2 files changed, 296 insertions(+), 286 deletions(-) diff --git a/README.md b/README.md index 259aca9..74adace 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ * [Show inline word diff.](https://github.com/git-tips/tips#show-inline-word-diff) * [Don’t consider changes for tracked file.](https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file) * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) +* [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) @@ -497,5 +498,10 @@ git update-index --assume-unchanged git update-index --no-assume-unchanged ``` +## Clean the files from `.gitignore`. +```sh +git clean -X -f +``` + diff --git a/tips.json b/tips.json index 80be09e..382b103 100644 --- a/tips.json +++ b/tips.json @@ -1,288 +1,292 @@ [ - { - "title": "Everyday Git in twenty commands or so", - "tip": "git help everyday" - }, - { - "title": "Show helpful guides that come with Git", - "tip": "git help -g" - }, - { - "title": "Overwrite pull", - "tip": "git fetch --all && git reset --hard origin/master" - }, - { - "title": "List of all files till a commit", - "tip": "git ls-tree --name-only -r " - }, - { - "title": "Git reset first commit", - "tip": "git update-ref -d HEAD" - }, - { - "title": "List all the conflicted files", - "tip": "git diff --name-only --diff-filter=U" - }, - { - "title": "List of all files changed in a commit", - "tip": "git diff-tree --no-commit-id --name-only -r " - }, - { - "title":"Unstaged changes since last commit", - "tip":"git diff" - }, - { - "title":"Changes staged for commit", - "tip":"git diff --cached" - }, - { - "title":"Show both staged and unstaged changes", - "tip":"git diff HEAD" - }, - { - "title": "List all branches that are already merged into master", - "tip": "git checkout master && git branch --merged" - }, - { - "title": "Quickly switch to the previous branch", - "tip": "git checkout -" - }, - { - "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" - }, - { - "title": "List all branches and their upstreams, as well as last commit on branch", - "tip": "git branch -vv" - }, - { - "title": "Track upstream branch", - "tip": "git branch -u origin/mybranch" - }, - { - "title": "Delete local branch", - "tip": "git branch -d " - }, - { - "title": "Delete remote branch", - "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] - }, - { - "title": "Undo local changes with the last content in head", - "tip": "git checkout -- " - }, - { - "title":"Revert: Undo a commit by creating a new commit", - "tip":"git revert " - }, - { - "title":"Reset: Discard commits, advised for private branch", - "tip":"git reset " - }, - { - "title": "Reword the previous commit message", - "tip": "git commit -v --amend" - }, - { - "title": "Changing a remote's URL", - "tip": "git remote set-url origin " - }, - { - "title": "Get list of all remote references", - "tip": "git remote", - "alternatives": ["git remote show"] - }, - { - "title": "Get list of all local and remote branches", - "tip": "git branch -a" - }, - { - "title": "Get only remote branches", - "tip": "git branch -r" - }, - { - "title": "Stage parts of a changed file, instead of the entire file", - "tip": "git add -p" - }, - { - "title": "Get git bash completion", - "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" - }, - { - "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 " - }, - { - "title": "Find out branches containing commit-hash", - "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] - }, - { - "title": "Git Aliases", - "tip": "git config --global alias. \ngit config --global alias.st status" - }, - { - "title":"Saving current state of tracked files without commiting", - "tip": "git stash", - "alternatives": ["git stash save"] - }, - { - "title":"Saving current state including untracked files", - "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] - }, - { - "title":"Show list of all saved stashes", - "tip": "git stash list" - }, - { - "title": "Apply any stash without deleting from the stashed list", - "tip": "git stash apply " - }, - { - "title":"Apply last stashed state and delete it from stashed list", - "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] - }, - { - "title": "Delete all stored stashes", - "tip": "git stash clear", - "alternatives": ["git stash drop "] - }, - { - "title":"Show all tracked files", - "tip":"git ls-files -t" - }, - { - "title":"Show all untracked files", - "tip":"git ls-files --others" - }, - { - "title": "Show all ignored files", - "tip": "git ls-files --others -i --exclude-standard" - }, - { - "title": "Create new working tree from a repository (git 2.5)", - "tip":"git worktree add -b " - }, - { - "title": "Create new working tree from HEAD state", - "tip": "git worktree add --detach HEAD" - }, - { - "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", - "tip": "git clean -n" - }, - { - "title": "Forcefully remove untracked files", - "tip": "git clean -f" - }, - { - "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d", - "alternatives": ["git clean -df"] - }, - { - "title": "Update all the submodules", - "tip": "git submodule foreach git pull" - }, - { - "title": "Show all commits in the current branch yet to be merged to master", - "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] - }, - { - "title": "Rename a branch", - "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] - }, - { - "title": "rebases 'feature' to 'master' and merges it in to master ", - "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" - }, - { - "title": "Archive the `master` branch", - "tip": "git archive master --format=zip --output=master.zip" - }, - { - "title": "Modify previous commit without modifying the commit message", - "tip": "git add --all && git commit --amend --no-edit" - }, - { - "title": "Prunes branches that have been deleted in the remote.", - "tip": "git fetch -p", - "alternatives":["git remote prune origin"] - }, - { - "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1" - }, - { - "title": "Visualize the version tree.", - "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives":["gitk --all"] - }, - { - "title": "Deploying git tracked subfolder to gh-pages", - "tip": "git subtree push --prefix subfolder_name origin gh-pages", - "alternatives": "git subtree push --prefix subfolder_name origin branch_name" - }, - { - "title": "Adding a project to repo using subtree", - "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" - }, - { - "title": "Get latest changes in your repo for a linked project using subtree", - "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" - }, - { - "title": "Export a branch with history to the a file.", - "tip": "git bundle create " - }, - { - "title": "Import from a bundle", - "tip": "git clone repo.bundle -b " - }, - { - "title": "Get the name of current branch.", - "tip": "git rev-parse --abbrev-ref HEAD" - }, - { - "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" - }, - { - "title": "Fetch pull request by ID to a local branch", - "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] - }, - { - "title": "Show the most recent tag on the current branch.", - "tip": "git describe --tags --abbrev=0" - }, - { - "title": "Show inline word diff.", - "tip": "git diff --word-diff" - }, - { - "title": "Don’t consider changes for tracked file.", - "tip": "git update-index --assume-unchanged " - }, - { - "title": "Undo assume-unchanged.", - "tip": "git update-index --no-assume-unchanged " - } + { + "title": "Everyday Git in twenty commands or so", + "tip": "git help everyday" + }, + { + "title": "Show helpful guides that come with Git", + "tip": "git help -g" + }, + { + "title": "Overwrite pull", + "tip": "git fetch --all && git reset --hard origin/master" + }, + { + "title": "List of all files till a commit", + "tip": "git ls-tree --name-only -r " + }, + { + "title": "Git reset first commit", + "tip": "git update-ref -d HEAD" + }, + { + "title": "List all the conflicted files", + "tip": "git diff --name-only --diff-filter=U" + }, + { + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " + }, + { + "title":"Unstaged changes since last commit", + "tip":"git diff" + }, + { + "title":"Changes staged for commit", + "tip":"git diff --cached" + }, + { + "title":"Show both staged and unstaged changes", + "tip":"git diff HEAD" + }, + { + "title": "List all branches that are already merged into master", + "tip": "git checkout master && git branch --merged" + }, + { + "title": "Quickly switch to the previous branch", + "tip": "git checkout -" + }, + { + "title": "Remove branches that have already been merged with master", + "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" + }, + { + "title": "List all branches and their upstreams, as well as last commit on branch", + "tip": "git branch -vv" + }, + { + "title": "Track upstream branch", + "tip": "git branch -u origin/mybranch" + }, + { + "title": "Delete local branch", + "tip": "git branch -d " + }, + { + "title": "Delete remote branch", + "tip": "git push origin --delete ", + "alternatives": ["git push origin :"] + }, + { + "title": "Undo local changes with the last content in head", + "tip": "git checkout -- " + }, + { + "title":"Revert: Undo a commit by creating a new commit", + "tip":"git revert " + }, + { + "title":"Reset: Discard commits, advised for private branch", + "tip":"git reset " + }, + { + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" + }, + { + "title": "Changing a remote's URL", + "tip": "git remote set-url origin " + }, + { + "title": "Get list of all remote references", + "tip": "git remote", + "alternatives": ["git remote show"] + }, + { + "title": "Get list of all local and remote branches", + "tip": "git branch -a" + }, + { + "title": "Get only remote branches", + "tip": "git branch -r" + }, + { + "title": "Stage parts of a changed file, instead of the entire file", + "tip": "git add -p" + }, + { + "title": "Get git bash completion", + "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" + }, + { + "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 " + }, + { + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] + }, + { + "title": "Git Aliases", + "tip": "git config --global alias. \ngit config --global alias.st status" + }, + { + "title":"Saving current state of tracked files without commiting", + "tip": "git stash", + "alternatives": ["git stash save"] + }, + { + "title":"Saving current state including untracked files", + "tip": "git stash save -u", + "alternatives": ["git stash save --include-untracked"] + }, + { + "title":"Show list of all saved stashes", + "tip": "git stash list" + }, + { + "title": "Apply any stash without deleting from the stashed list", + "tip": "git stash apply " + }, + { + "title":"Apply last stashed state and delete it from stashed list", + "tip": "git stash pop", + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] + }, + { + "title": "Delete all stored stashes", + "tip": "git stash clear", + "alternatives": ["git stash drop "] + }, + { + "title":"Show all tracked files", + "tip":"git ls-files -t" + }, + { + "title":"Show all untracked files", + "tip":"git ls-files --others" + }, + { + "title": "Show all ignored files", + "tip": "git ls-files --others -i --exclude-standard" + }, + { + "title": "Create new working tree from a repository (git 2.5)", + "tip":"git worktree add -b " + }, + { + "title": "Create new working tree from HEAD state", + "tip": "git worktree add --detach HEAD" + }, + { + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", + "tip": "git clean -n" + }, + { + "title": "Forcefully remove untracked files", + "tip": "git clean -f" + }, + { + "title": "Forcefully remove untracked directory", + "tip": "git clean -f -d", + "alternatives": ["git clean -df"] + }, + { + "title": "Update all the submodules", + "tip": "git submodule foreach git pull" + }, + { + "title": "Show all commits in the current branch yet to be merged to master", + "tip": "git cherry -v master", + "alternatives": ["git cherry -v master "] + }, + { + "title": "Rename a branch", + "tip": "git branch -m ", + "alternatives": ["git branch -m [] "] + }, + { + "title": "rebases 'feature' to 'master' and merges it in to master ", + "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" + }, + { + "title": "Archive the `master` branch", + "tip": "git archive master --format=zip --output=master.zip" + }, + { + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" + }, + { + "title": "Prunes branches that have been deleted in the remote.", + "tip": "git fetch -p", + "alternatives":["git remote prune origin"] + }, + { + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1" + }, + { + "title": "Visualize the version tree.", + "tip": "git log --pretty=oneline --graph --decorate --all", + "alternatives":["gitk --all"] + }, + { + "title": "Deploying git tracked subfolder to gh-pages", + "tip": "git subtree push --prefix subfolder_name origin gh-pages", + "alternatives": "git subtree push --prefix subfolder_name origin branch_name" + }, + { + "title": "Adding a project to repo using subtree", + "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" + }, + { + "title": "Get latest changes in your repo for a linked project using subtree", + "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" + }, + { + "title": "Export a branch with history to the a file.", + "tip": "git bundle create " + }, + { + "title": "Import from a bundle", + "tip": "git clone repo.bundle -b " + }, + { + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" + }, + { + "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" + }, + { + "title": "Fetch pull request by ID to a local branch", + "tip": "git fetch origin pull//head:", + "alternatives": ["git pull origin pull//head:"] + }, + { + "title": "Show the most recent tag on the current branch.", + "tip": "git describe --tags --abbrev=0" + }, + { + "title": "Show inline word diff.", + "tip": "git diff --word-diff" + }, + { + "title": "Don’t consider changes for tracked file.", + "tip": "git update-index --assume-unchanged " + }, + { + "title": "Undo assume-unchanged.", + "tip": "git update-index --no-assume-unchanged " + }, + { + "title": "Clean the files from `.gitignore`.", + "tip": "git clean -X -f" + } ] From 7078656d7c696b9c25012d612f379a40ed7deb1a Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 27 Dec 2015 19:08:25 +0530 Subject: [PATCH 068/251] Restore deleted file. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 74adace..83b272b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ * [Don’t consider changes for tracked file.](https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file) * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) +* [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) @@ -503,5 +504,10 @@ git update-index --no-assume-unchanged git clean -X -f ``` +## Restore deleted file. +```sh +git checkout ^ -- +``` + diff --git a/tips.json b/tips.json index 382b103..fdd3138 100644 --- a/tips.json +++ b/tips.json @@ -288,5 +288,9 @@ { "title": "Clean the files from `.gitignore`.", "tip": "git clean -X -f" + }, + { + "title": "Restore deleted file.", + "tip": "git checkout ^ -- " } ] From 3c31eac72180a42b6c06e0046adf91063e1bf658 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 1 Jan 2016 21:12:17 +0530 Subject: [PATCH 069/251] branch.autosetuprebase --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 83b272b..b4010a3 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) * [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) +* [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) @@ -509,5 +510,10 @@ git clean -X -f git checkout ^ -- ``` +## Always rebase instead of merge on pull. +```sh +git config --global branch.autosetuprebase always +``` + diff --git a/tips.json b/tips.json index fdd3138..a568a28 100644 --- a/tips.json +++ b/tips.json @@ -292,5 +292,9 @@ { "title": "Restore deleted file.", "tip": "git checkout ^ -- " + }, + { + "title": "Always rebase instead of merge on pull.", + "tip": "git config --global branch.autosetuprebase always" } ] From 321da85d47a1a64c374c3996f784519e6bceb640 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 17 Jan 2016 22:12:36 +0530 Subject: [PATCH 070/251] ammed author --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b4010a3..0ec9b04 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ * [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit) * [Reset: Discard commits, advised for private branch](https://github.com/git-tips/tips#reset-discard-commits-advised-for-private-branch) * [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message) +* [Amend author.](https://github.com/git-tips/tips#amend-author) * [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) @@ -192,6 +193,11 @@ git reset git commit -v --amend ``` +## Amend author. +```sh +git commit --amend --author='Author Name ' +``` + ## Changing a remote's URL ```sh git remote set-url origin diff --git a/tips.json b/tips.json index a568a28..a3eac82 100644 --- a/tips.json +++ b/tips.json @@ -84,6 +84,10 @@ "title": "Reword the previous commit message", "tip": "git commit -v --amend" }, + { + "title": "Amend author.", + "tip": "git commit --amend --author='Author Name '" + }, { "title": "Changing a remote's URL", "tip": "git remote set-url origin " From 2ce80d7d5d0fc111a7bc65523821d8cba41073e1 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 17 Jan 2016 22:13:52 +0530 Subject: [PATCH 071/251] Reset author --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 0ec9b04..33b8688 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ * [Reset: Discard commits, advised for private branch](https://github.com/git-tips/tips#reset-discard-commits-advised-for-private-branch) * [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message) * [Amend author.](https://github.com/git-tips/tips#amend-author) +* [Reset author, after author has been changed in the global config.](https://github.com/git-tips/tips#reset-author-after-author-has-been-changed-in-the-global-config) * [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) @@ -198,6 +199,11 @@ git commit -v --amend git commit --amend --author='Author Name ' ``` +## Reset author, after author has been changed in the global config. +```sh +git commit --amend --reset-author --no-edit +``` + ## Changing a remote's URL ```sh git remote set-url origin diff --git a/tips.json b/tips.json index a3eac82..1ce686c 100644 --- a/tips.json +++ b/tips.json @@ -88,6 +88,10 @@ "title": "Amend author.", "tip": "git commit --amend --author='Author Name '" }, + { + "title": "Reset author, after author has been changed in the global config.", + "tip": "git commit --amend --reset-author --no-edit" + }, { "title": "Changing a remote's URL", "tip": "git remote set-url origin " From c99cc15ad1d255cf7e9bc2dea34471d2a5c3ae0a Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 29 Jan 2016 22:07:26 +0530 Subject: [PATCH 072/251] Format --- tips.json | 542 +++++++++++++++++++++++------------------------------- 1 file changed, 234 insertions(+), 308 deletions(-) diff --git a/tips.json b/tips.json index 1ce686c..0753f69 100644 --- a/tips.json +++ b/tips.json @@ -1,308 +1,234 @@ -[ - { - "title": "Everyday Git in twenty commands or so", - "tip": "git help everyday" - }, - { - "title": "Show helpful guides that come with Git", - "tip": "git help -g" - }, - { - "title": "Overwrite pull", - "tip": "git fetch --all && git reset --hard origin/master" - }, - { - "title": "List of all files till a commit", - "tip": "git ls-tree --name-only -r " - }, - { - "title": "Git reset first commit", - "tip": "git update-ref -d HEAD" - }, - { - "title": "List all the conflicted files", - "tip": "git diff --name-only --diff-filter=U" - }, - { - "title": "List of all files changed in a commit", - "tip": "git diff-tree --no-commit-id --name-only -r " - }, - { - "title":"Unstaged changes since last commit", - "tip":"git diff" - }, - { - "title":"Changes staged for commit", - "tip":"git diff --cached" - }, - { - "title":"Show both staged and unstaged changes", - "tip":"git diff HEAD" - }, - { - "title": "List all branches that are already merged into master", - "tip": "git checkout master && git branch --merged" - }, - { - "title": "Quickly switch to the previous branch", - "tip": "git checkout -" - }, - { - "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" - }, - { - "title": "List all branches and their upstreams, as well as last commit on branch", - "tip": "git branch -vv" - }, - { - "title": "Track upstream branch", - "tip": "git branch -u origin/mybranch" - }, - { - "title": "Delete local branch", - "tip": "git branch -d " - }, - { - "title": "Delete remote branch", - "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] - }, - { - "title": "Undo local changes with the last content in head", - "tip": "git checkout -- " - }, - { - "title":"Revert: Undo a commit by creating a new commit", - "tip":"git revert " - }, - { - "title":"Reset: Discard commits, advised for private branch", - "tip":"git reset " - }, - { - "title": "Reword the previous commit message", - "tip": "git commit -v --amend" - }, - { - "title": "Amend author.", - "tip": "git commit --amend --author='Author Name '" - }, - { - "title": "Reset author, after author has been changed in the global config.", - "tip": "git commit --amend --reset-author --no-edit" - }, - { - "title": "Changing a remote's URL", - "tip": "git remote set-url origin " - }, - { - "title": "Get list of all remote references", - "tip": "git remote", - "alternatives": ["git remote show"] - }, - { - "title": "Get list of all local and remote branches", - "tip": "git branch -a" - }, - { - "title": "Get only remote branches", - "tip": "git branch -r" - }, - { - "title": "Stage parts of a changed file, instead of the entire file", - "tip": "git add -p" - }, - { - "title": "Get git bash completion", - "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" - }, - { - "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 " - }, - { - "title": "Find out branches containing commit-hash", - "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] - }, - { - "title": "Git Aliases", - "tip": "git config --global alias. \ngit config --global alias.st status" - }, - { - "title":"Saving current state of tracked files without commiting", - "tip": "git stash", - "alternatives": ["git stash save"] - }, - { - "title":"Saving current state including untracked files", - "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] - }, - { - "title":"Show list of all saved stashes", - "tip": "git stash list" - }, - { - "title": "Apply any stash without deleting from the stashed list", - "tip": "git stash apply " - }, - { - "title":"Apply last stashed state and delete it from stashed list", - "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] - }, - { - "title": "Delete all stored stashes", - "tip": "git stash clear", - "alternatives": ["git stash drop "] - }, - { - "title":"Show all tracked files", - "tip":"git ls-files -t" - }, - { - "title":"Show all untracked files", - "tip":"git ls-files --others" - }, - { - "title": "Show all ignored files", - "tip": "git ls-files --others -i --exclude-standard" - }, - { - "title": "Create new working tree from a repository (git 2.5)", - "tip":"git worktree add -b " - }, - { - "title": "Create new working tree from HEAD state", - "tip": "git worktree add --detach HEAD" - }, - { - "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", - "tip": "git clean -n" - }, - { - "title": "Forcefully remove untracked files", - "tip": "git clean -f" - }, - { - "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d", - "alternatives": ["git clean -df"] - }, - { - "title": "Update all the submodules", - "tip": "git submodule foreach git pull" - }, - { - "title": "Show all commits in the current branch yet to be merged to master", - "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] - }, - { - "title": "Rename a branch", - "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] - }, - { - "title": "rebases 'feature' to 'master' and merges it in to master ", - "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" - }, - { - "title": "Archive the `master` branch", - "tip": "git archive master --format=zip --output=master.zip" - }, - { - "title": "Modify previous commit without modifying the commit message", - "tip": "git add --all && git commit --amend --no-edit" - }, - { - "title": "Prunes branches that have been deleted in the remote.", - "tip": "git fetch -p", - "alternatives":["git remote prune origin"] - }, - { - "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1" - }, - { - "title": "Visualize the version tree.", - "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives":["gitk --all"] - }, - { - "title": "Deploying git tracked subfolder to gh-pages", - "tip": "git subtree push --prefix subfolder_name origin gh-pages", - "alternatives": "git subtree push --prefix subfolder_name origin branch_name" - }, - { - "title": "Adding a project to repo using subtree", - "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" - }, - { - "title": "Get latest changes in your repo for a linked project using subtree", - "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" - }, - { - "title": "Export a branch with history to the a file.", - "tip": "git bundle create " - }, - { - "title": "Import from a bundle", - "tip": "git clone repo.bundle -b " - }, - { - "title": "Get the name of current branch.", - "tip": "git rev-parse --abbrev-ref HEAD" - }, - { - "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" - }, - { - "title": "Fetch pull request by ID to a local branch", - "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] - }, - { - "title": "Show the most recent tag on the current branch.", - "tip": "git describe --tags --abbrev=0" - }, - { - "title": "Show inline word diff.", - "tip": "git diff --word-diff" - }, - { - "title": "Don’t consider changes for tracked file.", - "tip": "git update-index --assume-unchanged " - }, - { - "title": "Undo assume-unchanged.", - "tip": "git update-index --no-assume-unchanged " - }, - { - "title": "Clean the files from `.gitignore`.", - "tip": "git clean -X -f" - }, - { - "title": "Restore deleted file.", - "tip": "git checkout ^ -- " - }, - { - "title": "Always rebase instead of merge on pull.", - "tip": "git config --global branch.autosetuprebase always" - } -] +[{ + "title": "Everyday Git in twenty commands or so", + "tip": "git help everyday" +}, { + "title": "Show helpful guides that come with Git", + "tip": "git help -g" +}, { + "title": "Overwrite pull", + "tip": "git fetch --all && git reset --hard origin/master" +}, { + "title": "List of all files till a commit", + "tip": "git ls-tree --name-only -r " +}, { + "title": "Git reset first commit", + "tip": "git update-ref -d HEAD" +}, { + "title": "List all the conflicted files", + "tip": "git diff --name-only --diff-filter=U" +}, { + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " +}, { + "title": "Unstaged changes since last commit", + "tip": "git diff" +}, { + "title": "Changes staged for commit", + "tip": "git diff --cached" +}, { + "title": "Show both staged and unstaged changes", + "tip": "git diff HEAD" +}, { + "title": "List all branches that are already merged into master", + "tip": "git checkout master && git branch --merged" +}, { + "title": "Quickly switch to the previous branch", + "tip": "git checkout -" +}, { + "title": "Remove branches that have already been merged with master", + "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" +}, { + "title": "List all branches and their upstreams, as well as last commit on branch", + "tip": "git branch -vv" +}, { + "title": "Track upstream branch", + "tip": "git branch -u origin/mybranch" +}, { + "title": "Delete local branch", + "tip": "git branch -d " +}, { + "title": "Delete remote branch", + "tip": "git push origin --delete ", + "alternatives": ["git push origin :"] +}, { + "title": "Undo local changes with the last content in head", + "tip": "git checkout -- " +}, { + "title": "Revert: Undo a commit by creating a new commit", + "tip": "git revert " +}, { + "title": "Reset: Discard commits, advised for private branch", + "tip": "git reset " +}, { + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" +}, { + "title": "Amend author.", + "tip": "git commit --amend --author='Author Name '" +}, { + "title": "Reset author, after author has been changed in the global config.", + "tip": "git commit --amend --reset-author --no-edit" +}, { + "title": "Changing a remote's URL", + "tip": "git remote set-url origin " +}, { + "title": "Get list of all remote references", + "tip": "git remote", + "alternatives": ["git remote show"] +}, { + "title": "Get list of all local and remote branches", + "tip": "git branch -a" +}, { + "title": "Get only remote branches", + "tip": "git branch -r" +}, { + "title": "Stage parts of a changed file, instead of the entire file", + "tip": "git add -p" +}, { + "title": "Get git bash completion", + "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" +}, { + "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 " +}, { + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] +}, { + "title": "Git Aliases", + "tip": "git config --global alias. \ngit config --global alias.st status" +}, { + "title": "Saving current state of tracked files without commiting", + "tip": "git stash", + "alternatives": ["git stash save"] +}, { + "title": "Saving current state including untracked files", + "tip": "git stash save -u", + "alternatives": ["git stash save --include-untracked"] +}, { + "title": "Show list of all saved stashes", + "tip": "git stash list" +}, { + "title": "Apply any stash without deleting from the stashed list", + "tip": "git stash apply " +}, { + "title": "Apply last stashed state and delete it from stashed list", + "tip": "git stash pop", + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] +}, { + "title": "Delete all stored stashes", + "tip": "git stash clear", + "alternatives": ["git stash drop "] +}, { + "title": "Show all tracked files", + "tip": "git ls-files -t" +}, { + "title": "Show all untracked files", + "tip": "git ls-files --others" +}, { + "title": "Show all ignored files", + "tip": "git ls-files --others -i --exclude-standard" +}, { + "title": "Create new working tree from a repository (git 2.5)", + "tip": "git worktree add -b " +}, { + "title": "Create new working tree from HEAD state", + "tip": "git worktree add --detach HEAD" +}, { + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", + "tip": "git clean -n" +}, { + "title": "Forcefully remove untracked files", + "tip": "git clean -f" +}, { + "title": "Forcefully remove untracked directory", + "tip": "git clean -f -d", + "alternatives": ["git clean -df"] +}, { + "title": "Update all the submodules", + "tip": "git submodule foreach git pull" +}, { + "title": "Show all commits in the current branch yet to be merged to master", + "tip": "git cherry -v master", + "alternatives": ["git cherry -v master "] +}, { + "title": "Rename a branch", + "tip": "git branch -m ", + "alternatives": ["git branch -m [] "] +}, { + "title": "rebases 'feature' to 'master' and merges it in to master ", + "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" +}, { + "title": "Archive the `master` branch", + "tip": "git archive master --format=zip --output=master.zip" +}, { + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" +}, { + "title": "Prunes branches that have been deleted in the remote.", + "tip": "git fetch -p", + "alternatives": ["git remote prune origin"] +}, { + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1" +}, { + "title": "Visualize the version tree.", + "tip": "git log --pretty=oneline --graph --decorate --all", + "alternatives": ["gitk --all"] +}, { + "title": "Deploying git tracked subfolder to gh-pages", + "tip": "git subtree push --prefix subfolder_name origin gh-pages", + "alternatives": "git subtree push --prefix subfolder_name origin branch_name" +}, { + "title": "Adding a project to repo using subtree", + "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" +}, { + "title": "Get latest changes in your repo for a linked project using subtree", + "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" +}, { + "title": "Export a branch with history to the a file.", + "tip": "git bundle create " +}, { + "title": "Import from a bundle", + "tip": "git clone repo.bundle -b " +}, { + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" +}, { + "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" +}, { + "title": "Fetch pull request by ID to a local branch", + "tip": "git fetch origin pull//head:", + "alternatives": ["git pull origin pull//head:"] +}, { + "title": "Show the most recent tag on the current branch.", + "tip": "git describe --tags --abbrev=0" +}, { + "title": "Show inline word diff.", + "tip": "git diff --word-diff" +}, { + "title": "Don’t consider changes for tracked file.", + "tip": "git update-index --assume-unchanged " +}, { + "title": "Undo assume-unchanged.", + "tip": "git update-index --no-assume-unchanged " +}, { + "title": "Clean the files from `.gitignore`.", + "tip": "git clean -X -f" +}, { + "title": "Restore deleted file.", + "tip": "git checkout ^ -- " +}, { + "title": "Always rebase instead of merge on pull.", + "tip": "git config --global branch.autosetuprebase always" +}] From dfc0613a785454a80273f01521b3126b900baba0 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 29 Jan 2016 22:09:51 +0530 Subject: [PATCH 073/251] List config and alias --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 33b8688..5ed2003 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) * [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) * [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) +* [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) @@ -527,5 +528,10 @@ git checkout ^ -- git config --global branch.autosetuprebase always ``` +## List all the alias and configs. +```sh +git config --list +``` + diff --git a/tips.json b/tips.json index 0753f69..c9a66a9 100644 --- a/tips.json +++ b/tips.json @@ -231,4 +231,7 @@ }, { "title": "Always rebase instead of merge on pull.", "tip": "git config --global branch.autosetuprebase always" +}, { + "title": "List all the alias and configs.", + "tip": "git config --list" }] From f4b8b94f592a1b0a298c0629e30949e4d1e4d1f5 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 31 Jan 2016 20:58:17 +0530 Subject: [PATCH 074/251] Make git case sensitive. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 5ed2003..9b7e889 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ * [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) * [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) * [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) +* [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) @@ -533,5 +534,10 @@ git config --global branch.autosetuprebase always git config --list ``` +## Make git case sensitive. +```sh +git config --global core.ignorecase false +``` + diff --git a/tips.json b/tips.json index c9a66a9..8cbd5f8 100644 --- a/tips.json +++ b/tips.json @@ -234,4 +234,7 @@ }, { "title": "List all the alias and configs.", "tip": "git config --list" +}, { + "title": "Make git case sensitive.", + "tip": "git config --global core.ignorecase false" }] From f8d2278bd02dc4c62fc9a2a4e145ca204c19a682 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 31 Jan 2016 21:00:33 +0530 Subject: [PATCH 075/251] auto correct typos --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 9b7e889..d2b2f7e 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ * [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) * [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) * [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) +* [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) @@ -539,5 +540,10 @@ git config --list git config --global core.ignorecase false ``` +## Auto correct typos. +```sh +git config --global help.autocorrect 1 +``` + diff --git a/tips.json b/tips.json index 8cbd5f8..cf48f59 100644 --- a/tips.json +++ b/tips.json @@ -237,4 +237,7 @@ }, { "title": "Make git case sensitive.", "tip": "git config --global core.ignorecase false" +}, { + "title": "Auto correct typos.", + "tip": "git config --global help.autocorrect 1" }] From 7e6c5f71b24aea0cb7afd81b14c1c17e8c6c895e Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Tue, 2 Feb 2016 18:36:01 +0530 Subject: [PATCH 076/251] Check if the change was a part of a release. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index d2b2f7e..fdf180f 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ * [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) * [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) * [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) +* [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) @@ -545,5 +546,10 @@ git config --global core.ignorecase false git config --global help.autocorrect 1 ``` +## Check if the change was a part of a release. +```sh +git name-rev --name-only +``` + diff --git a/tips.json b/tips.json index cf48f59..dadd540 100644 --- a/tips.json +++ b/tips.json @@ -240,4 +240,7 @@ }, { "title": "Auto correct typos.", "tip": "git config --global help.autocorrect 1" +}, { + "title": "Check if the change was a part of a release.", + "tip": "git name-rev --name-only " }] From 90d98ea9807976dfaeac388670da3302d2c925a8 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 10 Feb 2016 17:26:02 +0530 Subject: [PATCH 077/251] --dry-run --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fdf180f..0936ad2 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ * [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) * [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) * [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) +* [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) @@ -551,5 +552,10 @@ git config --global help.autocorrect 1 git name-rev --name-only ``` +## Dry run. (any command that supports dry-run flag should do.) +```sh +git clean -fd --dry-run +``` + diff --git a/tips.json b/tips.json index dadd540..45f147a 100644 --- a/tips.json +++ b/tips.json @@ -243,4 +243,7 @@ }, { "title": "Check if the change was a part of a release.", "tip": "git name-rev --name-only " +}, { + "title": "Dry run. (any command that supports dry-run flag should do.)", + "tip": "git clean -fd --dry-run" }] From c42e1547abcc823db3b505cafc28f3074f75a9b0 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Fri, 12 Feb 2016 23:40:59 +0530 Subject: [PATCH 078/251] Grab a file from a stash. Restore file as per a commit hash --- README.md | 18 ++++++++++++++++++ tips.json | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 0936ad2..9a4d53d 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ * [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) * [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) +* [Grab a single file from a stash](https://github.com/git-tips/tips#grab-a-single-file-from-a-stash) * [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) @@ -75,6 +76,7 @@ * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) * [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) +* [Restore file to a specific commit-hash](https://github.com/git-tips/tips#restore-file-to-a-specific-commit-hash) * [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) * [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) * [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) @@ -331,6 +333,17 @@ __Alternatives:__ git stash drop ``` +## Grab a single file from a stash +```sh +git checkout -- +``` + + +__Alternatives:__ +```sh +git checkout stash@{0} -- +``` + ## Show all tracked files ```sh git ls-files -t @@ -527,6 +540,11 @@ git clean -X -f git checkout ^ -- ``` +## Restore file to a specific commit-hash +```sh +git checkout -- +``` + ## Always rebase instead of merge on pull. ```sh git config --global branch.autosetuprebase always diff --git a/tips.json b/tips.json index 45f147a..ff48dad 100644 --- a/tips.json +++ b/tips.json @@ -125,6 +125,10 @@ "title": "Delete all stored stashes", "tip": "git stash clear", "alternatives": ["git stash drop "] +}, { + "title": "Grab a single file from a stash", + "tip": "git checkout -- ", + "alternatives": ["git checkout stash@{0} -- "] }, { "title": "Show all tracked files", "tip": "git ls-files -t" @@ -228,6 +232,9 @@ }, { "title": "Restore deleted file.", "tip": "git checkout ^ -- " +}, { + "title": "Restore file to a specific commit-hash", + "tip": "git checkout -- " }, { "title": "Always rebase instead of merge on pull.", "tip": "git config --global branch.autosetuprebase always" From e416adc1ff51abecb14fd6ccd279661e41126c47 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Fri, 12 Feb 2016 23:56:56 +0530 Subject: [PATCH 079/251] Untrack files without deleting --- README.md | 12 ++++++++++++ tips.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 9a4d53d..557387b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) * [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) * [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) +* [Untrack files without deleting](https://github.com/git-tips/tips#untrack-files-without-deleting) * [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) * [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) @@ -369,6 +370,17 @@ git worktree add -b git worktree add --detach HEAD ``` +## Untrack files without deleting +```sh +git rm --cached +``` + + +__Alternatives:__ +```sh +git rm --cached -r +``` + ## Before deleting untracked files/directory, do a dry run to get the list of these files/directories ```sh git clean -n diff --git a/tips.json b/tips.json index ff48dad..0e0d6be 100644 --- a/tips.json +++ b/tips.json @@ -144,6 +144,10 @@ }, { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" +}, { + "title": "Untrack files without deleting", + "tip": "git rm --cached ", + "alternatives": ["git rm --cached -r "] }, { "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" From f886fd31fa7201fc7775887449dbeeaf863a1770 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 22 Feb 2016 19:16:57 +0530 Subject: [PATCH 080/251] --fixup tip --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 557387b..f6885c8 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ * [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) * [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) * [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) +* [Marks your commit as a fix of a previous commit](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) @@ -587,5 +588,10 @@ git name-rev --name-only git clean -fd --dry-run ``` +## Marks your commit as a fix of a previous commit +```sh +git commit --fixup +``` + diff --git a/tips.json b/tips.json index 0e0d6be..6848a83 100644 --- a/tips.json +++ b/tips.json @@ -257,4 +257,7 @@ }, { "title": "Dry run. (any command that supports dry-run flag should do.)", "tip": "git clean -fd --dry-run" +}, { + "title": "Marks your commit as a fix of a previous commit", + "tip": "git commit --fixup " }] From d07dd0040ce793628257b9ac9d168399420ead2f Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 22 Feb 2016 19:20:47 +0530 Subject: [PATCH 081/251] --autosquash tip --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f6885c8..d0aa04b 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ * [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) * [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) * [Marks your commit as a fix of a previous commit](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) +* [squash fixup commits normal commits.](https://github.com/git-tips/tips#squash-fixup-commits-normal-commits) @@ -593,5 +594,10 @@ git clean -fd --dry-run git commit --fixup ``` +## squash fixup commits normal commits. +```sh +git rebase -i --autosquash +``` + diff --git a/tips.json b/tips.json index 6848a83..e289dda 100644 --- a/tips.json +++ b/tips.json @@ -260,4 +260,7 @@ }, { "title": "Marks your commit as a fix of a previous commit", "tip": "git commit --fixup " +}, { + "title": "squash fixup commits normal commits.", + "tip": "git rebase -i --autosquash" }] From 7dcbedb26948031bba58eb6b0cead29211477a6f Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 26 Feb 2016 19:08:55 +0530 Subject: [PATCH 082/251] -am --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index d0aa04b..128b976 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ * [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) * [Marks your commit as a fix of a previous commit](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) * [squash fixup commits normal commits.](https://github.com/git-tips/tips#squash-fixup-commits-normal-commits) +* [skip staging area during commit](https://github.com/git-tips/tips#skip-staging-area-during-commit) @@ -599,5 +600,10 @@ git commit --fixup git rebase -i --autosquash ``` +## skip staging area during commit +```sh +git commit -am 'commit message' +``` + diff --git a/tips.json b/tips.json index e289dda..9cced4a 100644 --- a/tips.json +++ b/tips.json @@ -263,4 +263,7 @@ }, { "title": "squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" +}, { + "title": "skip staging area during commit", + "tip": "git commit -am 'commit message'" }] From 27f7cefb1bd584e5b5a9c9921d1303cbcb6e327e Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 2 Mar 2016 19:33:10 +0530 Subject: [PATCH 083/251] List ignored files. --- README.md | 14 ++++++++++---- tips.json | 7 +++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 128b976..52b51e5 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,10 @@ * [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) * [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) * [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) -* [Marks your commit as a fix of a previous commit](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) +* [Marks your commit as a fix of a previous commit.](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) * [squash fixup commits normal commits.](https://github.com/git-tips/tips#squash-fixup-commits-normal-commits) -* [skip staging area during commit](https://github.com/git-tips/tips#skip-staging-area-during-commit) +* [skip staging area during commit.](https://github.com/git-tips/tips#skip-staging-area-during-commit) +* [List ignored files.](https://github.com/git-tips/tips#list-ignored-files) @@ -590,7 +591,7 @@ git name-rev --name-only git clean -fd --dry-run ``` -## Marks your commit as a fix of a previous commit +## Marks your commit as a fix of a previous commit. ```sh git commit --fixup ``` @@ -600,10 +601,15 @@ git commit --fixup git rebase -i --autosquash ``` -## skip staging area during commit +## skip staging area during commit. ```sh git commit -am 'commit message' ``` +## List ignored files. +```sh +git check-ignore * +``` + diff --git a/tips.json b/tips.json index 9cced4a..d6eb28c 100644 --- a/tips.json +++ b/tips.json @@ -258,12 +258,15 @@ "title": "Dry run. (any command that supports dry-run flag should do.)", "tip": "git clean -fd --dry-run" }, { - "title": "Marks your commit as a fix of a previous commit", + "title": "Marks your commit as a fix of a previous commit.", "tip": "git commit --fixup " }, { "title": "squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" }, { - "title": "skip staging area during commit", + "title": "skip staging area during commit.", "tip": "git commit -am 'commit message'" +},{ + "title": "List ignored files.", + "tip": "git check-ignore *" }] From 46e66ce4b5ff58d7ba166926265767e8c56cb820 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 2 Mar 2016 19:36:56 +0530 Subject: [PATCH 084/251] Status of ignored files. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 52b51e5..f382da1 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ * [squash fixup commits normal commits.](https://github.com/git-tips/tips#squash-fixup-commits-normal-commits) * [skip staging area during commit.](https://github.com/git-tips/tips#skip-staging-area-during-commit) * [List ignored files.](https://github.com/git-tips/tips#list-ignored-files) +* [Status of ignored files.](https://github.com/git-tips/tips#status-of-ignored-files) @@ -611,5 +612,10 @@ git commit -am 'commit message' git check-ignore * ``` +## Status of ignored files. +```sh +git status --ignored +``` + diff --git a/tips.json b/tips.json index d6eb28c..b7bd46c 100644 --- a/tips.json +++ b/tips.json @@ -269,4 +269,7 @@ },{ "title": "List ignored files.", "tip": "git check-ignore *" +},{ + "title": "Status of ignored files.", + "tip": "git status --ignored" }] From a5be265d69f86a68128052ae21a5cb13b931cc04 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 6 Mar 2016 16:58:58 +0530 Subject: [PATCH 085/251] Commits in Branch1 that are not in Branch2 --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f382da1..f15d6e1 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ * [skip staging area during commit.](https://github.com/git-tips/tips#skip-staging-area-during-commit) * [List ignored files.](https://github.com/git-tips/tips#list-ignored-files) * [Status of ignored files.](https://github.com/git-tips/tips#status-of-ignored-files) +* [Commits in Branch1 that are not in Branch2](https://github.com/git-tips/tips#commits-in-branch1-that-are-not-in-branch2) @@ -617,5 +618,10 @@ git check-ignore * git status --ignored ``` +## Commits in Branch1 that are not in Branch2 +```sh +git log Branch1 ^Branch2 +``` + diff --git a/tips.json b/tips.json index b7bd46c..a67df09 100644 --- a/tips.json +++ b/tips.json @@ -272,4 +272,7 @@ },{ "title": "Status of ignored files.", "tip": "git status --ignored" +},{ + "title": "Commits in Branch1 that are not in Branch2", + "tip": "git log Branch1 ^Branch2" }] From 1ca386656a3ddcc86f3e28be88a5d62ecc789266 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 9 Mar 2016 22:28:58 +0530 Subject: [PATCH 086/251] rerere.enabled --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f15d6e1..2a6e9b9 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ * [List ignored files.](https://github.com/git-tips/tips#list-ignored-files) * [Status of ignored files.](https://github.com/git-tips/tips#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](https://github.com/git-tips/tips#commits-in-branch1-that-are-not-in-branch2) +* [reuse recorded resolution, record and reuse previous conflicts resolutions.](https://github.com/git-tips/tips#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) @@ -623,5 +624,10 @@ git status --ignored git log Branch1 ^Branch2 ``` +## reuse recorded resolution, record and reuse previous conflicts resolutions. +```sh +git config --global rerere.enabled 1 +``` + diff --git a/tips.json b/tips.json index a67df09..5d8c0e8 100644 --- a/tips.json +++ b/tips.json @@ -275,4 +275,7 @@ },{ "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" +}, { + "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", + "tip":"git config --global rerere.enabled 1" }] From def56a7e7b56b7bd687950b3ef2f09d2a97c32a6 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 11 Mar 2016 19:28:15 +0530 Subject: [PATCH 087/251] open conflicted files --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 2a6e9b9..d766842 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ * [Status of ignored files.](https://github.com/git-tips/tips#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](https://github.com/git-tips/tips#commits-in-branch1-that-are-not-in-branch2) * [reuse recorded resolution, record and reuse previous conflicts resolutions.](https://github.com/git-tips/tips#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) +* [Open all conflicted files in an editor.](https://github.com/git-tips/tips#open-all-conflicted-files-in-an-editor) @@ -629,5 +630,10 @@ git log Branch1 ^Branch2 git config --global rerere.enabled 1 ``` +## Open all conflicted files in an editor. +```sh +git diff --name-only | uniq | xargs $EDITOR +``` + diff --git a/tips.json b/tips.json index 5d8c0e8..03283a2 100644 --- a/tips.json +++ b/tips.json @@ -278,4 +278,7 @@ }, { "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", "tip":"git config --global rerere.enabled 1" +},{ + "title": "Open all conflicted files in an editor.", + "tip": "git diff --name-only | uniq | xargs $EDITOR" }] From 67b0393bb1c98972e89cdbdf099603402f20d115 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Tue, 29 Mar 2016 21:41:53 +0530 Subject: [PATCH 088/251] count-objects --- README.md | 8 +- tips.json | 399 +++++++++++++++++++++++++++--------------------------- 2 files changed, 208 insertions(+), 199 deletions(-) diff --git a/README.md b/README.md index d766842..692c4ca 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ * [Commits in Branch1 that are not in Branch2](https://github.com/git-tips/tips#commits-in-branch1-that-are-not-in-branch2) * [reuse recorded resolution, record and reuse previous conflicts resolutions.](https://github.com/git-tips/tips#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) * [Open all conflicted files in an editor.](https://github.com/git-tips/tips#open-all-conflicted-files-in-an-editor) +* [Count unpacked number of objects and their disk consumption.](https://github.com/git-tips/tips#count-unpacked-number-of-objects-and-their-disk-consumption) @@ -607,7 +608,7 @@ git rebase -i --autosquash ## skip staging area during commit. ```sh -git commit -am 'commit message' +git commit -am ``` ## List ignored files. @@ -635,5 +636,10 @@ git config --global rerere.enabled 1 git diff --name-only | uniq | xargs $EDITOR ``` +## Count unpacked number of objects and their disk consumption. +```sh +git count-objects --human-readable +``` + diff --git a/tips.json b/tips.json index 03283a2..5e12dcb 100644 --- a/tips.json +++ b/tips.json @@ -1,284 +1,287 @@ [{ - "title": "Everyday Git in twenty commands or so", - "tip": "git help everyday" + "title": "Everyday Git in twenty commands or so", + "tip": "git help everyday" }, { - "title": "Show helpful guides that come with Git", - "tip": "git help -g" + "title": "Show helpful guides that come with Git", + "tip": "git help -g" }, { - "title": "Overwrite pull", - "tip": "git fetch --all && git reset --hard origin/master" + "title": "Overwrite pull", + "tip": "git fetch --all && git reset --hard origin/master" }, { - "title": "List of all files till a commit", - "tip": "git ls-tree --name-only -r " + "title": "List of all files till a commit", + "tip": "git ls-tree --name-only -r " }, { - "title": "Git reset first commit", - "tip": "git update-ref -d HEAD" + "title": "Git reset first commit", + "tip": "git update-ref -d HEAD" }, { - "title": "List all the conflicted files", - "tip": "git diff --name-only --diff-filter=U" + "title": "List all the conflicted files", + "tip": "git diff --name-only --diff-filter=U" }, { - "title": "List of all files changed in a commit", - "tip": "git diff-tree --no-commit-id --name-only -r " + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " }, { - "title": "Unstaged changes since last commit", - "tip": "git diff" + "title": "Unstaged changes since last commit", + "tip": "git diff" }, { - "title": "Changes staged for commit", - "tip": "git diff --cached" + "title": "Changes staged for commit", + "tip": "git diff --cached" }, { - "title": "Show both staged and unstaged changes", - "tip": "git diff HEAD" + "title": "Show both staged and unstaged changes", + "tip": "git diff HEAD" }, { - "title": "List all branches that are already merged into master", - "tip": "git checkout master && git branch --merged" + "title": "List all branches that are already merged into master", + "tip": "git checkout master && git branch --merged" }, { - "title": "Quickly switch to the previous branch", - "tip": "git checkout -" + "title": "Quickly switch to the previous branch", + "tip": "git checkout -" }, { - "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" + "title": "Remove branches that have already been merged with master", + "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" }, { - "title": "List all branches and their upstreams, as well as last commit on branch", - "tip": "git branch -vv" + "title": "List all branches and their upstreams, as well as last commit on branch", + "tip": "git branch -vv" }, { - "title": "Track upstream branch", - "tip": "git branch -u origin/mybranch" + "title": "Track upstream branch", + "tip": "git branch -u origin/mybranch" }, { - "title": "Delete local branch", - "tip": "git branch -d " + "title": "Delete local branch", + "tip": "git branch -d " }, { - "title": "Delete remote branch", - "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] + "title": "Delete remote branch", + "tip": "git push origin --delete ", + "alternatives": ["git push origin :"] }, { - "title": "Undo local changes with the last content in head", - "tip": "git checkout -- " + "title": "Undo local changes with the last content in head", + "tip": "git checkout -- " }, { - "title": "Revert: Undo a commit by creating a new commit", - "tip": "git revert " + "title": "Revert: Undo a commit by creating a new commit", + "tip": "git revert " }, { - "title": "Reset: Discard commits, advised for private branch", - "tip": "git reset " + "title": "Reset: Discard commits, advised for private branch", + "tip": "git reset " }, { - "title": "Reword the previous commit message", - "tip": "git commit -v --amend" + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" }, { - "title": "Amend author.", - "tip": "git commit --amend --author='Author Name '" + "title": "Amend author.", + "tip": "git commit --amend --author='Author Name '" }, { - "title": "Reset author, after author has been changed in the global config.", - "tip": "git commit --amend --reset-author --no-edit" + "title": "Reset author, after author has been changed in the global config.", + "tip": "git commit --amend --reset-author --no-edit" }, { - "title": "Changing a remote's URL", - "tip": "git remote set-url origin " + "title": "Changing a remote's URL", + "tip": "git remote set-url origin " }, { - "title": "Get list of all remote references", - "tip": "git remote", - "alternatives": ["git remote show"] + "title": "Get list of all remote references", + "tip": "git remote", + "alternatives": ["git remote show"] }, { - "title": "Get list of all local and remote branches", - "tip": "git branch -a" + "title": "Get list of all local and remote branches", + "tip": "git branch -a" }, { - "title": "Get only remote branches", - "tip": "git branch -r" + "title": "Get only remote branches", + "tip": "git branch -r" }, { - "title": "Stage parts of a changed file, instead of the entire file", - "tip": "git add -p" + "title": "Stage parts of a changed file, instead of the entire file", + "tip": "git add -p" }, { - "title": "Get git bash completion", - "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" + "title": "Get git bash completion", + "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" }, { - "title": "What changed since two weeks?", - "tip": "git whatchanged --since='2 weeks ago'" + "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": "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 " + "title": "Pick commits across branches using cherry-pick", + "tip": "git checkout && cherry-pick " }, { - "title": "Find out branches containing commit-hash", - "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] }, { - "title": "Git Aliases", - "tip": "git config --global alias. \ngit config --global alias.st status" + "title": "Git Aliases", + "tip": "git config --global alias. \ngit config --global alias.st status" }, { - "title": "Saving current state of tracked files without commiting", - "tip": "git stash", - "alternatives": ["git stash save"] + "title": "Saving current state of tracked files without commiting", + "tip": "git stash", + "alternatives": ["git stash save"] }, { - "title": "Saving current state including untracked files", - "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] + "title": "Saving current state including untracked files", + "tip": "git stash save -u", + "alternatives": ["git stash save --include-untracked"] }, { - "title": "Show list of all saved stashes", - "tip": "git stash list" + "title": "Show list of all saved stashes", + "tip": "git stash list" }, { - "title": "Apply any stash without deleting from the stashed list", - "tip": "git stash apply " + "title": "Apply any stash without deleting from the stashed list", + "tip": "git stash apply " }, { - "title": "Apply last stashed state and delete it from stashed list", - "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] + "title": "Apply last stashed state and delete it from stashed list", + "tip": "git stash pop", + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] }, { - "title": "Delete all stored stashes", - "tip": "git stash clear", - "alternatives": ["git stash drop "] + "title": "Delete all stored stashes", + "tip": "git stash clear", + "alternatives": ["git stash drop "] }, { - "title": "Grab a single file from a stash", - "tip": "git checkout -- ", - "alternatives": ["git checkout stash@{0} -- "] + "title": "Grab a single file from a stash", + "tip": "git checkout -- ", + "alternatives": ["git checkout stash@{0} -- "] }, { - "title": "Show all tracked files", - "tip": "git ls-files -t" + "title": "Show all tracked files", + "tip": "git ls-files -t" }, { - "title": "Show all untracked files", - "tip": "git ls-files --others" + "title": "Show all untracked files", + "tip": "git ls-files --others" }, { - "title": "Show all ignored files", - "tip": "git ls-files --others -i --exclude-standard" + "title": "Show all ignored files", + "tip": "git ls-files --others -i --exclude-standard" }, { - "title": "Create new working tree from a repository (git 2.5)", - "tip": "git worktree add -b " + "title": "Create new working tree from a repository (git 2.5)", + "tip": "git worktree add -b " }, { - "title": "Create new working tree from HEAD state", - "tip": "git worktree add --detach HEAD" + "title": "Create new working tree from HEAD state", + "tip": "git worktree add --detach HEAD" }, { - "title": "Untrack files without deleting", - "tip": "git rm --cached ", - "alternatives": ["git rm --cached -r "] + "title": "Untrack files without deleting", + "tip": "git rm --cached ", + "alternatives": ["git rm --cached -r "] }, { - "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", - "tip": "git clean -n" + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", + "tip": "git clean -n" }, { - "title": "Forcefully remove untracked files", - "tip": "git clean -f" + "title": "Forcefully remove untracked files", + "tip": "git clean -f" }, { - "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d", - "alternatives": ["git clean -df"] + "title": "Forcefully remove untracked directory", + "tip": "git clean -f -d", + "alternatives": ["git clean -df"] }, { - "title": "Update all the submodules", - "tip": "git submodule foreach git pull" + "title": "Update all the submodules", + "tip": "git submodule foreach git pull" }, { - "title": "Show all commits in the current branch yet to be merged to master", - "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] + "title": "Show all commits in the current branch yet to be merged to master", + "tip": "git cherry -v master", + "alternatives": ["git cherry -v master "] }, { - "title": "Rename a branch", - "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] + "title": "Rename a branch", + "tip": "git branch -m ", + "alternatives": ["git branch -m [] "] }, { - "title": "rebases 'feature' to 'master' and merges it in to master ", - "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" + "title": "rebases 'feature' to 'master' and merges it in to master ", + "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" }, { - "title": "Archive the `master` branch", - "tip": "git archive master --format=zip --output=master.zip" + "title": "Archive the `master` branch", + "tip": "git archive master --format=zip --output=master.zip" }, { - "title": "Modify previous commit without modifying the commit message", - "tip": "git add --all && git commit --amend --no-edit" + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" }, { - "title": "Prunes branches that have been deleted in the remote.", - "tip": "git fetch -p", - "alternatives": ["git remote prune origin"] + "title": "Prunes branches that have been deleted in the remote.", + "tip": "git fetch -p", + "alternatives": ["git remote prune origin"] }, { - "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1" + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1" }, { - "title": "Visualize the version tree.", - "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": ["gitk --all"] + "title": "Visualize the version tree.", + "tip": "git log --pretty=oneline --graph --decorate --all", + "alternatives": ["gitk --all"] }, { - "title": "Deploying git tracked subfolder to gh-pages", - "tip": "git subtree push --prefix subfolder_name origin gh-pages", - "alternatives": "git subtree push --prefix subfolder_name origin branch_name" + "title": "Deploying git tracked subfolder to gh-pages", + "tip": "git subtree push --prefix subfolder_name origin gh-pages", + "alternatives": "git subtree push --prefix subfolder_name origin branch_name" }, { - "title": "Adding a project to repo using subtree", - "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" + "title": "Adding a project to repo using subtree", + "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" }, { - "title": "Get latest changes in your repo for a linked project using subtree", - "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" + "title": "Get latest changes in your repo for a linked project using subtree", + "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" }, { - "title": "Export a branch with history to the a file.", - "tip": "git bundle create " + "title": "Export a branch with history to the a file.", + "tip": "git bundle create " }, { - "title": "Import from a bundle", - "tip": "git clone repo.bundle -b " + "title": "Import from a bundle", + "tip": "git clone repo.bundle -b " }, { - "title": "Get the name of current branch.", - "tip": "git rev-parse --abbrev-ref HEAD" + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" }, { - "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": "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" + "title": "Stash changes before rebasing", + "tip": "git rebase --autostash" }, { - "title": "Fetch pull request by ID to a local branch", - "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] + "title": "Fetch pull request by ID to a local branch", + "tip": "git fetch origin pull//head:", + "alternatives": ["git pull origin pull//head:"] }, { - "title": "Show the most recent tag on the current branch.", - "tip": "git describe --tags --abbrev=0" + "title": "Show the most recent tag on the current branch.", + "tip": "git describe --tags --abbrev=0" }, { - "title": "Show inline word diff.", - "tip": "git diff --word-diff" + "title": "Show inline word diff.", + "tip": "git diff --word-diff" }, { - "title": "Don’t consider changes for tracked file.", - "tip": "git update-index --assume-unchanged " + "title": "Don’t consider changes for tracked file.", + "tip": "git update-index --assume-unchanged " }, { - "title": "Undo assume-unchanged.", - "tip": "git update-index --no-assume-unchanged " + "title": "Undo assume-unchanged.", + "tip": "git update-index --no-assume-unchanged " }, { - "title": "Clean the files from `.gitignore`.", - "tip": "git clean -X -f" + "title": "Clean the files from `.gitignore`.", + "tip": "git clean -X -f" }, { - "title": "Restore deleted file.", - "tip": "git checkout ^ -- " + "title": "Restore deleted file.", + "tip": "git checkout ^ -- " }, { - "title": "Restore file to a specific commit-hash", - "tip": "git checkout -- " + "title": "Restore file to a specific commit-hash", + "tip": "git checkout -- " }, { - "title": "Always rebase instead of merge on pull.", - "tip": "git config --global branch.autosetuprebase always" + "title": "Always rebase instead of merge on pull.", + "tip": "git config --global branch.autosetuprebase always" }, { - "title": "List all the alias and configs.", - "tip": "git config --list" + "title": "List all the alias and configs.", + "tip": "git config --list" }, { - "title": "Make git case sensitive.", - "tip": "git config --global core.ignorecase false" + "title": "Make git case sensitive.", + "tip": "git config --global core.ignorecase false" }, { - "title": "Auto correct typos.", - "tip": "git config --global help.autocorrect 1" + "title": "Auto correct typos.", + "tip": "git config --global help.autocorrect 1" }, { - "title": "Check if the change was a part of a release.", - "tip": "git name-rev --name-only " + "title": "Check if the change was a part of a release.", + "tip": "git name-rev --name-only " }, { - "title": "Dry run. (any command that supports dry-run flag should do.)", - "tip": "git clean -fd --dry-run" + "title": "Dry run. (any command that supports dry-run flag should do.)", + "tip": "git clean -fd --dry-run" }, { - "title": "Marks your commit as a fix of a previous commit.", - "tip": "git commit --fixup " + "title": "Marks your commit as a fix of a previous commit.", + "tip": "git commit --fixup " }, { - "title": "squash fixup commits normal commits.", - "tip": "git rebase -i --autosquash" + "title": "squash fixup commits normal commits.", + "tip": "git rebase -i --autosquash" }, { - "title": "skip staging area during commit.", - "tip": "git commit -am 'commit message'" -},{ - "title": "List ignored files.", - "tip": "git check-ignore *" -},{ - "title": "Status of ignored files.", - "tip": "git status --ignored" -},{ - "title": "Commits in Branch1 that are not in Branch2", - "tip": "git log Branch1 ^Branch2" + "title": "skip staging area during commit.", + "tip": "git commit -am " }, { - "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip":"git config --global rerere.enabled 1" -},{ - "title": "Open all conflicted files in an editor.", - "tip": "git diff --name-only | uniq | xargs $EDITOR" + "title": "List ignored files.", + "tip": "git check-ignore *" +}, { + "title": "Status of ignored files.", + "tip": "git status --ignored" +}, { + "title": "Commits in Branch1 that are not in Branch2", + "tip": "git log Branch1 ^Branch2" +}, { + "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", + "tip":"git config --global rerere.enabled 1" +}, { + "title": "Open all conflicted files in an editor.", + "tip": "git diff --name-only | uniq | xargs $EDITOR" +}, { + "title": "Count unpacked number of objects and their disk consumption.", + "tip": "git count-objects --human-readable" }] From 33c82592ac3558550b7a93a1c987480b787c9891 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Tue, 29 Mar 2016 21:45:21 +0530 Subject: [PATCH 089/251] gc --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 692c4ca..0ffec01 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ * [reuse recorded resolution, record and reuse previous conflicts resolutions.](https://github.com/git-tips/tips#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) * [Open all conflicted files in an editor.](https://github.com/git-tips/tips#open-all-conflicted-files-in-an-editor) * [Count unpacked number of objects and their disk consumption.](https://github.com/git-tips/tips#count-unpacked-number-of-objects-and-their-disk-consumption) +* [Prune all unreachable objects from the object database.](https://github.com/git-tips/tips#prune-all-unreachable-objects-from-the-object-database) @@ -641,5 +642,10 @@ git diff --name-only | uniq | xargs $EDITOR git count-objects --human-readable ``` +## Prune all unreachable objects from the object database. +```sh +git gc --prune=now --aggressive +``` + diff --git a/tips.json b/tips.json index 5e12dcb..5f719a6 100644 --- a/tips.json +++ b/tips.json @@ -284,4 +284,7 @@ }, { "title": "Count unpacked number of objects and their disk consumption.", "tip": "git count-objects --human-readable" +}, { + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" }] From a01ef67d14f0c257513abc687524beb6b99ae977 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 2 Apr 2016 22:00:49 +0530 Subject: [PATCH 090/251] instaweb --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 0ffec01..9b06dfc 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ * [Open all conflicted files in an editor.](https://github.com/git-tips/tips#open-all-conflicted-files-in-an-editor) * [Count unpacked number of objects and their disk consumption.](https://github.com/git-tips/tips#count-unpacked-number-of-objects-and-their-disk-consumption) * [Prune all unreachable objects from the object database.](https://github.com/git-tips/tips#prune-all-unreachable-objects-from-the-object-database) +* [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb) @@ -647,5 +648,10 @@ git count-objects --human-readable git gc --prune=now --aggressive ``` +## Instantly browse your working repository in gitweb. +```sh +git instaweb [--local] [--httpd=] [--port=] [--browser=] +``` + diff --git a/tips.json b/tips.json index 5f719a6..4d29733 100644 --- a/tips.json +++ b/tips.json @@ -287,4 +287,7 @@ }, { "title": "Prune all unreachable objects from the object database.", "tip": "git gc --prune=now --aggressive" +},{ + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" }] From 1cde458164fe5cf07dda51d7f869b06a99641558 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 6 Apr 2016 18:57:11 +0530 Subject: [PATCH 091/251] GPG sig in logs --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 9b06dfc..153db34 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ * [Count unpacked number of objects and their disk consumption.](https://github.com/git-tips/tips#count-unpacked-number-of-objects-and-their-disk-consumption) * [Prune all unreachable objects from the object database.](https://github.com/git-tips/tips#prune-all-unreachable-objects-from-the-object-database) * [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb) +* [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log) @@ -653,5 +654,10 @@ git gc --prune=now --aggressive git instaweb [--local] [--httpd=] [--port=] [--browser=] ``` +## View the GPG signatures in the commit log +```sh +git log --show-signature +``` + diff --git a/tips.json b/tips.json index 4d29733..a43fb6d 100644 --- a/tips.json +++ b/tips.json @@ -290,4 +290,7 @@ },{ "title": "Instantly browse your working repository in gitweb.", "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" +},{ + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" }] From 8b9d2366f1db10b8111112da0fcd7c6fe3166c08 Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Wed, 6 Apr 2016 14:20:46 -0600 Subject: [PATCH 092/251] Added tip to remove an entry from the global config. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 153db34..53eb393 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ * [Prune all unreachable objects from the object database.](https://github.com/git-tips/tips#prune-all-unreachable-objects-from-the-object-database) * [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb) * [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log) +* [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config) @@ -659,5 +660,10 @@ git instaweb [--local] [--httpd=] [--port=] [--browser=] git log --show-signature ``` +## Remove entry in the global config. +```sh +git config --global --unset +``` + diff --git a/tips.json b/tips.json index a43fb6d..332f546 100644 --- a/tips.json +++ b/tips.json @@ -293,4 +293,7 @@ },{ "title": "View the GPG signatures in the commit log", "tip": "git log --show-signature" +}, { + "title": "Remove entry in the global config.", + "tip": "git config --global --unset " }] From 157337d356bbc15877f365bd9cf88b136b8f1be7 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 10 Apr 2016 21:07:36 +0530 Subject: [PATCH 093/251] orphan branch --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 53eb393..4876efc 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ * [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb) * [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log) * [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config) +* [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history) @@ -665,5 +666,10 @@ git log --show-signature git config --global --unset ``` +## Checkout a new branch without any history +```sh +git checkout --orphan +``` + diff --git a/tips.json b/tips.json index 332f546..f0959cf 100644 --- a/tips.json +++ b/tips.json @@ -296,4 +296,7 @@ }, { "title": "Remove entry in the global config.", "tip": "git config --global --unset " +},{ + "title": "Checkout a new branch without any history", + "tip": "git checkout --orphan " }] From 168303734bbdb70b1fb93d2c12c00b2cfafe6728 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 18 Apr 2016 20:11:57 +0530 Subject: [PATCH 094/251] staged diff --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 4876efc..d34ee90 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ * [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log) * [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config) * [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history) +* [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version) @@ -671,5 +672,10 @@ git config --global --unset git checkout --orphan ``` +## File diff between staging and the last file version. +```sh +git diff --staged +``` + diff --git a/tips.json b/tips.json index f0959cf..c34b4f1 100644 --- a/tips.json +++ b/tips.json @@ -299,4 +299,7 @@ },{ "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " +},{ + "title": "File diff between staging and the last file version.", + "tip": "git diff --staged" }] From b238e44ff134b915747a6f820084ccdd3c7fcd83 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 29 Apr 2016 20:18:50 +0530 Subject: [PATCH 095/251] git show --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index d34ee90..98e8cf2 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ * [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config) * [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history) * [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version) +* [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) @@ -677,5 +678,10 @@ git checkout --orphan git diff --staged ``` +## Extract file from another branch. +```sh +git show : +``` + diff --git a/tips.json b/tips.json index c34b4f1..9508db3 100644 --- a/tips.json +++ b/tips.json @@ -302,4 +302,7 @@ },{ "title": "File diff between staging and the last file version.", "tip": "git diff --staged" +},{ + "title": "Extract file from another branch.", + "tip": "git show :" }] From dc8e9d6f963b0455a6c7146d7afca347ebf61bb9 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 11 May 2016 22:24:34 +0530 Subject: [PATCH 096/251] root and merge commits tips. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 98e8cf2..b08f264 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ * [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history) * [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version) * [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) +* [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits) @@ -683,5 +684,10 @@ git diff --staged git show : ``` +## List only the root and merge commits. +```sh +git log --first-parent +``` + diff --git a/tips.json b/tips.json index 9508db3..f6af834 100644 --- a/tips.json +++ b/tips.json @@ -305,4 +305,7 @@ },{ "title": "Extract file from another branch.", "tip": "git show :" +}, { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" }] From 80e1993266c95ad5ab8f85539fd7438cb4f9bdd6 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Wed, 18 May 2016 17:33:13 +0530 Subject: [PATCH 097/251] merging two commits into one. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index b08f264..c75ad48 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ * [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version) * [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) * [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits) +* [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one) @@ -689,5 +690,10 @@ git show : git log --first-parent ``` +## Merge previous two commits into one. +```sh +git rebase --interactive HEAD~2 +``` + diff --git a/tips.json b/tips.json index f6af834..df23a19 100644 --- a/tips.json +++ b/tips.json @@ -308,4 +308,7 @@ }, { "title": "List only the root and merge commits.", "tip": "git log --first-parent" +}, { + "title": "Merge previous two commits into one.", + "tip": "git rebase --interactive HEAD~2" }] From 312b4a6c99263609249f177fdba1ca65925f2149 Mon Sep 17 00:00:00 2001 From: zxcxz7 Date: Thu, 26 May 2016 17:37:51 +0900 Subject: [PATCH 098/251] Add list command --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index c75ad48..dac0a86 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ * [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) * [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one) +* [List of git repositories in multiple directories.](https://github.com/git-tips/tips#list-of-git-repositories-in-multiple-directories) @@ -695,5 +696,10 @@ git log --first-parent git rebase --interactive HEAD~2 ``` +## List of git repositories in multiple directories. +```sh +find /path1 /path2 /path3 -regex '.*\.git' -type d -print0 | xargs -0 -I {} dirname {} +``` + diff --git a/tips.json b/tips.json index df23a19..107cbe7 100644 --- a/tips.json +++ b/tips.json @@ -311,4 +311,7 @@ }, { "title": "Merge previous two commits into one.", "tip": "git rebase --interactive HEAD~2" +}, { + "title": "List of git repositories in multiple directories.", + "tip": "find /path1 /path2 /path3 -regex '.*\\.git' -type d -print0 | xargs -0 -I {} dirname {}" }] From 55e2d4fa75837e3e79b8639050c640998b209bc6 Mon Sep 17 00:00:00 2001 From: zxcxz7 Date: Thu, 26 May 2016 23:17:03 +0900 Subject: [PATCH 099/251] Update tip and add an alternative Update find command to exclude hidden directories. Add GNU find command --- README.md | 12 +++++++++++- tips.json | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dac0a86..4e30d1b 100644 --- a/README.md +++ b/README.md @@ -698,7 +698,17 @@ git rebase --interactive HEAD~2 ## List of git repositories in multiple directories. ```sh -find /path1 /path2 /path3 -regex '.*\.git' -type d -print0 | xargs -0 -I {} dirname {} +find -E ${targetdir} \( -regex '.*/\.git + -not -regex '.*/\..*/\.git + \) -type d -print0 | xargs -0 -I {} dirname {} +``` + + +__Alternatives:__ +```sh +find ${targetdir} -regextype posix-egrep \( -regex '.*/\.git + -not -regex '.*/\..*/\.git + \) -type d -print0 | xargs -0 -I {} dirname {} ``` diff --git a/tips.json b/tips.json index 107cbe7..6aa8bf7 100644 --- a/tips.json +++ b/tips.json @@ -313,5 +313,6 @@ "tip": "git rebase --interactive HEAD~2" }, { "title": "List of git repositories in multiple directories.", - "tip": "find /path1 /path2 /path3 -regex '.*\\.git' -type d -print0 | xargs -0 -I {} dirname {}" + "tip": "find -E ${targetdir} \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}", + "alternatives": ["find ${targetdir} -regextype posix-egrep \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}"] }] From 04323cc7be3c51af116c5dcfe66fd3d4faea2aca Mon Sep 17 00:00:00 2001 From: zxcxz7 Date: Thu, 26 May 2016 23:21:31 +0900 Subject: [PATCH 100/251] Correct paths --- README.md | 4 ++-- tips.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e30d1b..f2ac52b 100644 --- a/README.md +++ b/README.md @@ -698,7 +698,7 @@ git rebase --interactive HEAD~2 ## List of git repositories in multiple directories. ```sh -find -E ${targetdir} \( -regex '.*/\.git +find -E /path1 /path2 /path3 \( -regex '.*/\.git -not -regex '.*/\..*/\.git \) -type d -print0 | xargs -0 -I {} dirname {} ``` @@ -706,7 +706,7 @@ find -E ${targetdir} \( -regex '.*/\.git __Alternatives:__ ```sh -find ${targetdir} -regextype posix-egrep \( -regex '.*/\.git +find /path1 /path2 /path3 -regextype posix-egrep \( -regex '.*/\.git -not -regex '.*/\..*/\.git \) -type d -print0 | xargs -0 -I {} dirname {} ``` diff --git a/tips.json b/tips.json index 6aa8bf7..d9ed1d3 100644 --- a/tips.json +++ b/tips.json @@ -313,6 +313,6 @@ "tip": "git rebase --interactive HEAD~2" }, { "title": "List of git repositories in multiple directories.", - "tip": "find -E ${targetdir} \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}", - "alternatives": ["find ${targetdir} -regextype posix-egrep \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}"] + "tip": "find -E /path1 /path2 /path3 \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}", + "alternatives": ["find /path1 /path2 /path3 -regextype posix-egrep \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}"] }] From e5d29ecd55cc9e9b2346011fa311ce725bddfca7 Mon Sep 17 00:00:00 2001 From: HyeonChol Jang Date: Mon, 30 May 2016 13:45:10 +0900 Subject: [PATCH 101/251] Revert "Add list command" --- README.md | 16 ---------------- tips.json | 4 ---- 2 files changed, 20 deletions(-) diff --git a/README.md b/README.md index f2ac52b..c75ad48 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,6 @@ * [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) * [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one) -* [List of git repositories in multiple directories.](https://github.com/git-tips/tips#list-of-git-repositories-in-multiple-directories) @@ -696,20 +695,5 @@ git log --first-parent git rebase --interactive HEAD~2 ``` -## List of git repositories in multiple directories. -```sh -find -E /path1 /path2 /path3 \( -regex '.*/\.git - -not -regex '.*/\..*/\.git - \) -type d -print0 | xargs -0 -I {} dirname {} -``` - - -__Alternatives:__ -```sh -find /path1 /path2 /path3 -regextype posix-egrep \( -regex '.*/\.git - -not -regex '.*/\..*/\.git - \) -type d -print0 | xargs -0 -I {} dirname {} -``` - diff --git a/tips.json b/tips.json index d9ed1d3..df23a19 100644 --- a/tips.json +++ b/tips.json @@ -311,8 +311,4 @@ }, { "title": "Merge previous two commits into one.", "tip": "git rebase --interactive HEAD~2" -}, { - "title": "List of git repositories in multiple directories.", - "tip": "find -E /path1 /path2 /path3 \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}", - "alternatives": ["find /path1 /path2 /path3 -regextype posix-egrep \\( -regex '.*/\\.git$' -not -regex '.*/\\..*/\\.git$' \\) -type d -print0 | xargs -0 -I {} dirname {}"] }] From 4906001a1deee2356cea0b94ece092d3e7f2fe07 Mon Sep 17 00:00:00 2001 From: Joel Gallant Date: Wed, 1 Jun 2016 10:47:51 -0600 Subject: [PATCH 102/251] Adding git to `cherry-pick` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c75ad48..7046962 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,7 @@ git log --no-merges --stat --reverse master.. ## Pick commits across branches using cherry-pick ```sh -git checkout && cherry-pick +git checkout && git cherry-pick ``` ## Find out branches containing commit-hash From 1279208ef30e90d6e662d71a730b2107c3e92dd7 Mon Sep 17 00:00:00 2001 From: Joel Gallant Date: Wed, 1 Jun 2016 10:49:41 -0600 Subject: [PATCH 103/251] Adding git to `cherry-pick` --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index df23a19..755eb1c 100644 --- a/tips.json +++ b/tips.json @@ -95,7 +95,7 @@ "tip": "git log --no-merges --stat --reverse master.." }, { "title": "Pick commits across branches using cherry-pick", - "tip": "git checkout && cherry-pick " + "tip": "git checkout && git cherry-pick " }, { "title": "Find out branches containing commit-hash", "tip": "git branch -a --contains ", From 0969a61d46a6a1d3d5dee4dc74707e5b7891d7d8 Mon Sep 17 00:00:00 2001 From: surfer190 Date: Thu, 2 Jun 2016 13:14:25 +0200 Subject: [PATCH 104/251] Change wording to show references are removed --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 755eb1c..590227c 100644 --- a/tips.json +++ b/tips.json @@ -179,7 +179,7 @@ "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" }, { - "title": "Prunes branches that have been deleted in the remote.", + "title": "Prunes references to remote branches that have been deleted in the remote.", "tip": "git fetch -p", "alternatives": ["git remote prune origin"] }, { From 9c321b0923c7b4dd85f6722386486439626af230 Mon Sep 17 00:00:00 2001 From: surfer190 Date: Thu, 2 Jun 2016 13:14:58 +0200 Subject: [PATCH 105/251] Remove absolute links --- .doxie.render.toc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.doxie.render.toc.js b/.doxie.render.toc.js index 92af283..bc74e84 100644 --- a/.doxie.render.toc.js +++ b/.doxie.render.toc.js @@ -11,7 +11,7 @@ slugify = function(text){ var render = function(data) { var data = data.data; - var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slugify(data.title) + ')\n'; + var out = '* [' + data.title + '](#' + slugify(data.title) + ')\n'; return out; }; From f85d7b231a1c9c6db3a94f325a441d37a3be9d48 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 5 Jun 2016 09:12:39 +0530 Subject: [PATCH 106/251] More info --- README.md | 202 +++++++++++++++++++++++++++--------------------------- 1 file changed, 102 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index 7046962..5656cff 100644 --- a/README.md +++ b/README.md @@ -1,107 +1,109 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) +P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. + -* [Everyday Git in twenty commands or so](https://github.com/git-tips/tips#everyday-git-in-twenty-commands-or-so) -* [Show helpful guides that come with Git](https://github.com/git-tips/tips#show-helpful-guides-that-come-with-git) -* [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) -* [List all the conflicted files](https://github.com/git-tips/tips#list-all-the-conflicted-files) -* [List of all files changed in a commit](https://github.com/git-tips/tips#list-of-all-files-changed-in-a-commit) -* [Unstaged changes since last commit](https://github.com/git-tips/tips#unstaged-changes-since-last-commit) -* [Changes staged for commit](https://github.com/git-tips/tips#changes-staged-for-commit) -* [Show both staged and unstaged changes](https://github.com/git-tips/tips#show-both-staged-and-unstaged-changes) -* [List all branches that are already merged into master](https://github.com/git-tips/tips#list-all-branches-that-are-already-merged-into-master) -* [Quickly switch to the previous branch](https://github.com/git-tips/tips#quickly-switch-to-the-previous-branch) -* [Remove branches that have already been merged with master](https://github.com/git-tips/tips#remove-branches-that-have-already-been-merged-with-master) -* [List all branches and their upstreams, as well as last commit on branch](https://github.com/git-tips/tips#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) -* [Track upstream branch](https://github.com/git-tips/tips#track-upstream-branch) -* [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) -* [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit) -* [Reset: Discard commits, advised for private branch](https://github.com/git-tips/tips#reset-discard-commits-advised-for-private-branch) -* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message) -* [Amend author.](https://github.com/git-tips/tips#amend-author) -* [Reset author, after author has been changed in the global config.](https://github.com/git-tips/tips#reset-author-after-author-has-been-changed-in-the-global-config) -* [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) -* [Get only remote branches](https://github.com/git-tips/tips#get-only-remote-branches) -* [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) -* [Saving current state of tracked files without commiting](https://github.com/git-tips/tips#saving-current-state-of-tracked-files-without-commiting) -* [Saving current state including untracked files](https://github.com/git-tips/tips#saving-current-state-including-untracked-files) -* [Show list of all saved stashes](https://github.com/git-tips/tips#show-list-of-all-saved-stashes) -* [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) -* [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) -* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) -* [Grab a single file from a stash](https://github.com/git-tips/tips#grab-a-single-file-from-a-stash) -* [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) -* [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) -* [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) -* [Untrack files without deleting](https://github.com/git-tips/tips#untrack-files-without-deleting) -* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) -* [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) -* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) -* [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) -* [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) -* [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) -* [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) -* [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) -* [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) -* [Prunes branches that have been deleted in the remote.](https://github.com/git-tips/tips#prunes-branches-that-have-been-deleted-in-the-remote) -* [Retrieve the commit hash of the initial revision.](https://github.com/git-tips/tips#retrieve-the-commit-hash-of-the-initial-revision) -* [Visualize the version tree.](https://github.com/git-tips/tips#visualize-the-version-tree) -* [Deploying git tracked subfolder to gh-pages](https://github.com/git-tips/tips#deploying-git-tracked-subfolder-to-gh-pages) -* [Adding a project to repo using subtree](https://github.com/git-tips/tips#adding-a-project-to-repo-using-subtree) -* [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) -* [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file) -* [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) -* [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch) -* [Show the most recent tag on the current branch.](https://github.com/git-tips/tips#show-the-most-recent-tag-on-the-current-branch) -* [Show inline word diff.](https://github.com/git-tips/tips#show-inline-word-diff) -* [Don’t consider changes for tracked file.](https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file) -* [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) -* [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) -* [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) -* [Restore file to a specific commit-hash](https://github.com/git-tips/tips#restore-file-to-a-specific-commit-hash) -* [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull) -* [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs) -* [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive) -* [Auto correct typos.](https://github.com/git-tips/tips#auto-correct-typos) -* [Check if the change was a part of a release.](https://github.com/git-tips/tips#check-if-the-change-was-a-part-of-a-release) -* [Dry run. (any command that supports dry-run flag should do.)](https://github.com/git-tips/tips#dry-run-any-command-that-supports-dry-run-flag-should-do) -* [Marks your commit as a fix of a previous commit.](https://github.com/git-tips/tips#marks-your-commit-as-a-fix-of-a-previous-commit) -* [squash fixup commits normal commits.](https://github.com/git-tips/tips#squash-fixup-commits-normal-commits) -* [skip staging area during commit.](https://github.com/git-tips/tips#skip-staging-area-during-commit) -* [List ignored files.](https://github.com/git-tips/tips#list-ignored-files) -* [Status of ignored files.](https://github.com/git-tips/tips#status-of-ignored-files) -* [Commits in Branch1 that are not in Branch2](https://github.com/git-tips/tips#commits-in-branch1-that-are-not-in-branch2) -* [reuse recorded resolution, record and reuse previous conflicts resolutions.](https://github.com/git-tips/tips#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) -* [Open all conflicted files in an editor.](https://github.com/git-tips/tips#open-all-conflicted-files-in-an-editor) -* [Count unpacked number of objects and their disk consumption.](https://github.com/git-tips/tips#count-unpacked-number-of-objects-and-their-disk-consumption) -* [Prune all unreachable objects from the object database.](https://github.com/git-tips/tips#prune-all-unreachable-objects-from-the-object-database) -* [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb) -* [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log) -* [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config) -* [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history) -* [File diff between staging and the last file version.](https://github.com/git-tips/tips#file-diff-between-staging-and-the-last-file-version) -* [Extract file from another branch.](https://github.com/git-tips/tips#extract-file-from-another-branch) -* [List only the root and merge commits.](https://github.com/git-tips/tips#list-only-the-root-and-merge-commits) -* [Merge previous two commits into one.](https://github.com/git-tips/tips#merge-previous-two-commits-into-one) +* [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) +* [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) +* [Overwrite pull](#overwrite-pull) +* [List of all files till a commit](#list-of-all-files-till-a-commit) +* [Git reset first commit](#git-reset-first-commit) +* [List all the conflicted files](#list-all-the-conflicted-files) +* [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit) +* [Unstaged changes since last commit](#unstaged-changes-since-last-commit) +* [Changes staged for commit](#changes-staged-for-commit) +* [Show both staged and unstaged changes](#show-both-staged-and-unstaged-changes) +* [List all branches that are already merged into master](#list-all-branches-that-are-already-merged-into-master) +* [Quickly switch to the previous branch](#quickly-switch-to-the-previous-branch) +* [Remove branches that have already been merged with master](#remove-branches-that-have-already-been-merged-with-master) +* [List all branches and their upstreams, as well as last commit on branch](#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) +* [Track upstream branch](#track-upstream-branch) +* [Delete local branch](#delete-local-branch) +* [Delete remote branch](#delete-remote-branch) +* [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head) +* [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit) +* [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch) +* [Reword the previous commit message](#reword-the-previous-commit-message) +* [Amend author.](#amend-author) +* [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config) +* [Changing a remote's URL](#changing-a-remotes-url) +* [Get list of all remote references](#get-list-of-all-remote-references) +* [Get list of all local and remote branches](#get-list-of-all-local-and-remote-branches) +* [Get only remote branches](#get-only-remote-branches) +* [Stage parts of a changed file, instead of the entire file](#stage-parts-of-a-changed-file-instead-of-the-entire-file) +* [Get git bash completion](#get-git-bash-completion) +* [What changed since two weeks?](#what-changed-since-two-weeks) +* [See all commits made since forking from master](#see-all-commits-made-since-forking-from-master) +* [Pick commits across branches using cherry-pick](#pick-commits-across-branches-using-cherry-pick) +* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash) +* [Git Aliases](#git-aliases) +* [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) +* [Saving current state including untracked files](#saving-current-state-including-untracked-files) +* [Show list of all saved stashes](#show-list-of-all-saved-stashes) +* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) +* [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) +* [Delete all stored stashes](#delete-all-stored-stashes) +* [Grab a single file from a stash](#grab-a-single-file-from-a-stash) +* [Show all tracked files](#show-all-tracked-files) +* [Show all untracked files](#show-all-untracked-files) +* [Show all ignored files](#show-all-ignored-files) +* [Create new working tree from a repository (git 2.5)](#create-new-working-tree-from-a-repository-git-25) +* [Create new working tree from HEAD state](#create-new-working-tree-from-head-state) +* [Untrack files without deleting](#untrack-files-without-deleting) +* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) +* [Forcefully remove untracked files](#forcefully-remove-untracked-files) +* [Forcefully remove untracked directory](#forcefully-remove-untracked-directory) +* [Update all the submodules](#update-all-the-submodules) +* [Show all commits in the current branch yet to be merged to master](#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) +* [Rename a branch](#rename-a-branch) +* [rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) +* [Archive the `master` branch](#archive-the-master-branch) +* [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message) +* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) +* [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision) +* [Visualize the version tree.](#visualize-the-version-tree) +* [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages) +* [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree) +* [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) +* [Export a branch with history to the a file.](#export-a-branch-with-history-to-the-a-file) +* [Import from a bundle](#import-from-a-bundle) +* [Get the name of current branch.](#get-the-name-of-current-branch) +* [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog) +* [Stash changes before rebasing](#stash-changes-before-rebasing) +* [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch) +* [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch) +* [Show inline word diff.](#show-inline-word-diff) +* [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file) +* [Undo assume-unchanged.](#undo-assume-unchanged) +* [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore) +* [Restore deleted file.](#restore-deleted-file) +* [Restore file to a specific commit-hash](#restore-file-to-a-specific-commit-hash) +* [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull) +* [List all the alias and configs.](#list-all-the-alias-and-configs) +* [Make git case sensitive.](#make-git-case-sensitive) +* [Auto correct typos.](#auto-correct-typos) +* [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release) +* [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do) +* [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit) +* [squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) +* [skip staging area during commit.](#skip-staging-area-during-commit) +* [List ignored files.](#list-ignored-files) +* [Status of ignored files.](#status-of-ignored-files) +* [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) +* [reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) +* [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) +* [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) +* [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database) +* [Instantly browse your working repository in gitweb.](#instantly-browse-your-working-repository-in-gitweb) +* [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log) +* [Remove entry in the global config.](#remove-entry-in-the-global-config) +* [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history) +* [File diff between staging and the last file version.](#file-diff-between-staging-and-the-last-file-version) +* [Extract file from another branch.](#extract-file-from-another-branch) +* [List only the root and merge commits.](#list-only-the-root-and-merge-commits) +* [Merge previous two commits into one.](#merge-previous-two-commits-into-one) @@ -462,7 +464,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Prunes branches that have been deleted in the remote. +## Prunes references to remote branches that have been deleted in the remote. ```sh git fetch -p ``` From 9c8e924bcac8b0e17a8930aedb49c3df7f94a7a2 Mon Sep 17 00:00:00 2001 From: Santiago Castro Date: Sun, 5 Jun 2016 15:23:49 -0300 Subject: [PATCH 107/251] 'to the a file' -> 'to a file' --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5656cff..54919c6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages) * [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree) * [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) -* [Export a branch with history to the a file.](#export-a-branch-with-history-to-the-a-file) +* [Export a branch with history to a file.](#export-a-branch-with-history-to-a-file) * [Import from a bundle](#import-from-a-bundle) * [Get the name of current branch.](#get-the-name-of-current-branch) * [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog) @@ -506,7 +506,7 @@ git subtree add --prefix=/ --squash git@github.com git subtree pull --prefix=/ --squash git@github.com:/.git master ``` -## Export a branch with history to the a file. +## Export a branch with history to a file. ```sh git bundle create ``` diff --git a/tips.json b/tips.json index 590227c..9858c47 100644 --- a/tips.json +++ b/tips.json @@ -200,7 +200,7 @@ "title": "Get latest changes in your repo for a linked project using subtree", "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" }, { - "title": "Export a branch with history to the a file.", + "title": "Export a branch with history to a file.", "tip": "git bundle create " }, { "title": "Import from a bundle", From bbbde86e8d55e5cb530e2f7032366b5deb9bfe75 Mon Sep 17 00:00:00 2001 From: Nam Pham Date: Tue, 7 Jun 2016 10:42:27 +0700 Subject: [PATCH 108/251] Add: List all brach is WIP --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 54919c6..2af0e2d 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Extract file from another branch.](#extract-file-from-another-branch) * [List only the root and merge commits.](#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](#merge-previous-two-commits-into-one) +* [List all branch is WIP](#list-all-branch-is-wip) @@ -697,5 +698,10 @@ git log --first-parent git rebase --interactive HEAD~2 ``` +## List all branch is WIP +```sh +git checkout master && git branch --no-merged +``` + diff --git a/tips.json b/tips.json index 9858c47..dfffb7a 100644 --- a/tips.json +++ b/tips.json @@ -311,4 +311,7 @@ }, { "title": "Merge previous two commits into one.", "tip": "git rebase --interactive HEAD~2" +}, { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" }] From 998a5c85234d354494aa4f02079e0c8fc286d472 Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Tue, 7 Jun 2016 09:30:05 +0200 Subject: [PATCH 109/251] Branches merged into master without checkout first --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index dfffb7a..7d00c7b 100644 --- a/tips.json +++ b/tips.json @@ -30,7 +30,7 @@ "tip": "git diff HEAD" }, { "title": "List all branches that are already merged into master", - "tip": "git checkout master && git branch --merged" + "tip": "git branch --merged master" }, { "title": "Quickly switch to the previous branch", "tip": "git checkout -" From aec9d8b1a39cddb579df502e0c75fba1b7b0bf4e Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Tue, 7 Jun 2016 09:32:41 +0200 Subject: [PATCH 110/251] Improve cleaning up branches merged into master --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index dfffb7a..727db1b 100644 --- a/tips.json +++ b/tips.json @@ -36,7 +36,7 @@ "tip": "git checkout -" }, { "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" + "tip": "git branch --merged master | grep -v '^\\*' | xargs --no-run-if-empty -n 1 git branch -d" }, { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" From ba5cd1c4f1dc3a274462bf6cfe9195617cd7461b Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Tue, 7 Jun 2016 09:42:13 +0200 Subject: [PATCH 111/251] Use log instead of whatchanged As per documentation (https://git-scm.com/docs/git-whatchanged): "New users are encouraged to use git-log(1) instead. The whatchanged command is essentially the same as git-log(1) but defaults to show the raw format diff output and to skip merges. The command is kept primarily for historical reasons; fingers of many people who learned Git long before git log was invented by reading Linux kernel mailing list are trained to type it." --- tips.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tips.json b/tips.json index dfffb7a..d3cad05 100644 --- a/tips.json +++ b/tips.json @@ -89,7 +89,8 @@ "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" }, { "title": "What changed since two weeks?", - "tip": "git whatchanged --since='2 weeks ago'" + "tip": "git log --no-merges --raw --since='2 weeks ago'", + "alternatives": ["git whatchanged --since='2 weeks ago'"] }, { "title": "See all commits made since forking from master", "tip": "git log --no-merges --stat --reverse master.." From 1b29a23e95a582c05aec2ad2e5428fdf3ab96dbb Mon Sep 17 00:00:00 2001 From: Alexander Pavlov Date: Tue, 7 Jun 2016 23:31:49 +0500 Subject: [PATCH 112/251] NEW: Add info about git bisect --- README.md | 12 ++ tips.json | 370 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 249 insertions(+), 133 deletions(-) diff --git a/README.md b/README.md index 2af0e2d..4fb5ad3 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List only the root and merge commits.](#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](#merge-previous-two-commits-into-one) * [List all branch is WIP](#list-all-branch-is-wip) +* [Find guilty with binary search](#find-guilty) @@ -703,5 +704,16 @@ git rebase --interactive HEAD~2 git checkout master && git branch --no-merged ``` +## Find guilty with binary search + +```sh +git bisect start # Search start +git bisect bad # Set point to bad commit +git bisect good v2.6.13-rc2 # Set point to good commit|tag +git bisect bad # Say current state is bad +git bisect good # Say current state is good +git bisect reset # Finish search +``` + diff --git a/tips.json b/tips.json index dfffb7a..0fe33b5 100644 --- a/tips.json +++ b/tips.json @@ -1,317 +1,421 @@ -[{ +[ + { "title": "Everyday Git in twenty commands or so", "tip": "git help everyday" -}, { + }, + { "title": "Show helpful guides that come with Git", "tip": "git help -g" -}, { + }, + { "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" -}, { + }, + { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " -}, { + }, + { "title": "Git reset first commit", "tip": "git update-ref -d HEAD" -}, { + }, + { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" -}, { + }, + { "title": "List of all files changed in a commit", "tip": "git diff-tree --no-commit-id --name-only -r " -}, { + }, + { "title": "Unstaged changes since last commit", "tip": "git diff" -}, { + }, + { "title": "Changes staged for commit", "tip": "git diff --cached" -}, { + }, + { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" -}, { + }, + { "title": "List all branches that are already merged into master", "tip": "git checkout master && git branch --merged" -}, { + }, + { "title": "Quickly switch to the previous branch", "tip": "git checkout -" -}, { + }, + { "title": "Remove branches that have already been merged with master", "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" -}, { + }, + { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" -}, { + }, + { "title": "Track upstream branch", "tip": "git branch -u origin/mybranch" -}, { + }, + { "title": "Delete local branch", "tip": "git branch -d " -}, { + }, + { "title": "Delete remote branch", "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] -}, { + "alternatives": [ "git push origin :" ] + }, + { "title": "Undo local changes with the last content in head", "tip": "git checkout -- " -}, { + }, + { "title": "Revert: Undo a commit by creating a new commit", "tip": "git revert " -}, { + }, + { "title": "Reset: Discard commits, advised for private branch", "tip": "git reset " -}, { + }, + { "title": "Reword the previous commit message", "tip": "git commit -v --amend" -}, { + }, + { "title": "Amend author.", "tip": "git commit --amend --author='Author Name '" -}, { + }, + { "title": "Reset author, after author has been changed in the global config.", "tip": "git commit --amend --reset-author --no-edit" -}, { + }, + { "title": "Changing a remote's URL", "tip": "git remote set-url origin " -}, { + }, + { "title": "Get list of all remote references", "tip": "git remote", - "alternatives": ["git remote show"] -}, { + "alternatives": [ "git remote show" ] + }, + { "title": "Get list of all local and remote branches", "tip": "git branch -a" -}, { + }, + { "title": "Get only remote branches", "tip": "git branch -r" -}, { + }, + { "title": "Stage parts of a changed file, instead of the entire file", "tip": "git add -p" -}, { + }, + { "title": "Get git bash completion", "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" -}, { + }, + { "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 && git cherry-pick " -}, { + }, + { "title": "Find out branches containing commit-hash", "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] -}, { + "alternatives": [ "git branch --contains " ] + }, + { "title": "Git Aliases", "tip": "git config --global alias. \ngit config --global alias.st status" -}, { + }, + { "title": "Saving current state of tracked files without commiting", "tip": "git stash", - "alternatives": ["git stash save"] -}, { + "alternatives": [ "git stash save" ] + }, + { "title": "Saving current state including untracked files", "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] -}, { + "alternatives": [ "git stash save --include-untracked" ] + }, + { "title": "Show list of all saved stashes", "tip": "git stash list" -}, { + }, + { "title": "Apply any stash without deleting from the stashed list", "tip": "git stash apply " -}, { + }, + { "title": "Apply last stashed state and delete it from stashed list", "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] -}, { + "alternatives": [ "git stash apply stash@{0} && git stash drop stash@{0}" ] + }, + { "title": "Delete all stored stashes", "tip": "git stash clear", - "alternatives": ["git stash drop "] -}, { + "alternatives": [ "git stash drop " ] + }, + { "title": "Grab a single file from a stash", "tip": "git checkout -- ", - "alternatives": ["git checkout stash@{0} -- "] -}, { + "alternatives": [ "git checkout stash@{0} -- " ] + }, + { "title": "Show all tracked files", "tip": "git ls-files -t" -}, { + }, + { "title": "Show all untracked files", "tip": "git ls-files --others" -}, { + }, + { "title": "Show all ignored files", "tip": "git ls-files --others -i --exclude-standard" -}, { + }, + { "title": "Create new working tree from a repository (git 2.5)", "tip": "git worktree add -b " -}, { + }, + { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" -}, { + }, + { "title": "Untrack files without deleting", "tip": "git rm --cached ", - "alternatives": ["git rm --cached -r "] -}, { + "alternatives": [ "git rm --cached -r " ] + }, + { "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" -}, { + }, + { "title": "Forcefully remove untracked files", "tip": "git clean -f" -}, { + }, + { "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", - "alternatives": ["git clean -df"] -}, { + "alternatives": [ "git clean -df" ] + }, + { "title": "Update all the submodules", "tip": "git submodule foreach git pull" -}, { + }, + { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] -}, { + "alternatives": [ "git cherry -v master " ] + }, + { "title": "Rename a branch", "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] -}, { + "alternatives": [ "git branch -m [] " ] + }, + { "title": "rebases 'feature' to 'master' and merges it in to master ", "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" -}, { + }, + { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" -}, { + }, + { "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" -}, { + }, + { "title": "Prunes references to remote branches that have been deleted in the remote.", "tip": "git fetch -p", - "alternatives": ["git remote prune origin"] -}, { + "alternatives": [ "git remote prune origin" ] + }, + { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1" -}, { + }, + { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": ["gitk --all"] -}, { + "alternatives": [ "gitk --all" ] + }, + { "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", "alternatives": "git subtree push --prefix subfolder_name origin branch_name" -}, { + }, + { "title": "Adding a project to repo using subtree", "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" -}, { + }, + { "title": "Get latest changes in your repo for a linked project using subtree", "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" -}, { + }, + { "title": "Export a branch with history to a file.", "tip": "git bundle create " -}, { + }, + { "title": "Import from a bundle", "tip": "git clone repo.bundle -b " -}, { + }, + { "title": "Get the name of current branch.", "tip": "git rev-parse --abbrev-ref HEAD" -}, { + }, + { "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" -}, { + }, + { "title": "Fetch pull request by ID to a local branch", "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] -}, { + "alternatives": [ "git pull origin pull//head:" ] + }, + { "title": "Show the most recent tag on the current branch.", "tip": "git describe --tags --abbrev=0" -}, { + }, + { "title": "Show inline word diff.", "tip": "git diff --word-diff" -}, { + }, + { "title": "Don’t consider changes for tracked file.", "tip": "git update-index --assume-unchanged " -}, { + }, + { "title": "Undo assume-unchanged.", "tip": "git update-index --no-assume-unchanged " -}, { + }, + { "title": "Clean the files from `.gitignore`.", "tip": "git clean -X -f" -}, { + }, + { "title": "Restore deleted file.", "tip": "git checkout ^ -- " -}, { + }, + { "title": "Restore file to a specific commit-hash", "tip": "git checkout -- " -}, { + }, + { "title": "Always rebase instead of merge on pull.", "tip": "git config --global branch.autosetuprebase always" -}, { + }, + { "title": "List all the alias and configs.", "tip": "git config --list" -}, { + }, + { "title": "Make git case sensitive.", "tip": "git config --global core.ignorecase false" -}, { + }, + { "title": "Auto correct typos.", "tip": "git config --global help.autocorrect 1" -}, { + }, + { "title": "Check if the change was a part of a release.", "tip": "git name-rev --name-only " -}, { + }, + { "title": "Dry run. (any command that supports dry-run flag should do.)", "tip": "git clean -fd --dry-run" -}, { + }, + { "title": "Marks your commit as a fix of a previous commit.", "tip": "git commit --fixup " -}, { + }, + { "title": "squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" -}, { + }, + { "title": "skip staging area during commit.", "tip": "git commit -am " -}, { + }, + { "title": "List ignored files.", "tip": "git check-ignore *" -}, { + }, + { "title": "Status of ignored files.", "tip": "git status --ignored" -}, { + }, + { "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" -}, { + }, + { "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip":"git config --global rerere.enabled 1" -}, { + "tip": "git config --global rerere.enabled 1" + }, + { "title": "Open all conflicted files in an editor.", "tip": "git diff --name-only | uniq | xargs $EDITOR" -}, { + }, + { "title": "Count unpacked number of objects and their disk consumption.", "tip": "git count-objects --human-readable" -}, { - "title": "Prune all unreachable objects from the object database.", - "tip": "git gc --prune=now --aggressive" -},{ - "title": "Instantly browse your working repository in gitweb.", - "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" -},{ - "title": "View the GPG signatures in the commit log", - "tip": "git log --show-signature" -}, { + }, + { + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" + }, + { + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" + }, + { + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" + }, + { "title": "Remove entry in the global config.", "tip": "git config --global --unset " -},{ + }, + { "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " -},{ - "title": "File diff between staging and the last file version.", - "tip": "git diff --staged" -},{ - "title": "Extract file from another branch.", - "tip": "git show :" -}, { - "title": "List only the root and merge commits.", - "tip": "git log --first-parent" -}, { - "title": "Merge previous two commits into one.", - "tip": "git rebase --interactive HEAD~2" -}, { - "title": "List all branch is WIP", - "tip": "git checkout master && git branch --no-merged" -}] + }, + { + "title": "File diff between staging and the last file version.", + "tip": "git diff --staged" + }, + { + "title": "Extract file from another branch.", + "tip": "git show :" + }, + { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" + }, + { + "title": "Merge previous two commits into one.", + "tip": "git rebase --interactive HEAD~2" + }, + { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" + }, + { + "title": "Find guilty with binary search", + "tip": "git bisect start\t\t\t\t# Search start \\ngit bisect bad\t\t\t\t\t# Set point to bad commit \\ngit bisect good v2.6.13-rc2\t\t# Set point to good commit|tag \\ngit bisect bad\t\t\t\t\t# Say current state is bad \\ngit bisect good\t\t\t\t\t# Say current state is good \\ngit bisect reset\t\t\t\t# Finish search \\n" + }] From 285989a70741a344c1ee1c6b3c7e34905e6cd30a Mon Sep 17 00:00:00 2001 From: Alexander Pavlov Date: Tue, 7 Jun 2016 23:31:49 +0500 Subject: [PATCH 113/251] NEW: Add info about git bisect --- README.md | 12 ++ tips.json | 370 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 249 insertions(+), 133 deletions(-) diff --git a/README.md b/README.md index 2af0e2d..b7b7efb 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List only the root and merge commits.](#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](#merge-previous-two-commits-into-one) * [List all branch is WIP](#list-all-branch-is-wip) +* [Find guilty with binary search](#find-guilty-with-binary-search) @@ -703,5 +704,16 @@ git rebase --interactive HEAD~2 git checkout master && git branch --no-merged ``` +## Find guilty with binary search + +```sh +git bisect start # Search start +git bisect bad # Set point to bad commit +git bisect good v2.6.13-rc2 # Set point to good commit|tag +git bisect bad # Say current state is bad +git bisect good # Say current state is good +git bisect reset # Finish search +``` + diff --git a/tips.json b/tips.json index dfffb7a..0fe33b5 100644 --- a/tips.json +++ b/tips.json @@ -1,317 +1,421 @@ -[{ +[ + { "title": "Everyday Git in twenty commands or so", "tip": "git help everyday" -}, { + }, + { "title": "Show helpful guides that come with Git", "tip": "git help -g" -}, { + }, + { "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" -}, { + }, + { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " -}, { + }, + { "title": "Git reset first commit", "tip": "git update-ref -d HEAD" -}, { + }, + { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" -}, { + }, + { "title": "List of all files changed in a commit", "tip": "git diff-tree --no-commit-id --name-only -r " -}, { + }, + { "title": "Unstaged changes since last commit", "tip": "git diff" -}, { + }, + { "title": "Changes staged for commit", "tip": "git diff --cached" -}, { + }, + { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" -}, { + }, + { "title": "List all branches that are already merged into master", "tip": "git checkout master && git branch --merged" -}, { + }, + { "title": "Quickly switch to the previous branch", "tip": "git checkout -" -}, { + }, + { "title": "Remove branches that have already been merged with master", "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" -}, { + }, + { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" -}, { + }, + { "title": "Track upstream branch", "tip": "git branch -u origin/mybranch" -}, { + }, + { "title": "Delete local branch", "tip": "git branch -d " -}, { + }, + { "title": "Delete remote branch", "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] -}, { + "alternatives": [ "git push origin :" ] + }, + { "title": "Undo local changes with the last content in head", "tip": "git checkout -- " -}, { + }, + { "title": "Revert: Undo a commit by creating a new commit", "tip": "git revert " -}, { + }, + { "title": "Reset: Discard commits, advised for private branch", "tip": "git reset " -}, { + }, + { "title": "Reword the previous commit message", "tip": "git commit -v --amend" -}, { + }, + { "title": "Amend author.", "tip": "git commit --amend --author='Author Name '" -}, { + }, + { "title": "Reset author, after author has been changed in the global config.", "tip": "git commit --amend --reset-author --no-edit" -}, { + }, + { "title": "Changing a remote's URL", "tip": "git remote set-url origin " -}, { + }, + { "title": "Get list of all remote references", "tip": "git remote", - "alternatives": ["git remote show"] -}, { + "alternatives": [ "git remote show" ] + }, + { "title": "Get list of all local and remote branches", "tip": "git branch -a" -}, { + }, + { "title": "Get only remote branches", "tip": "git branch -r" -}, { + }, + { "title": "Stage parts of a changed file, instead of the entire file", "tip": "git add -p" -}, { + }, + { "title": "Get git bash completion", "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" -}, { + }, + { "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 && git cherry-pick " -}, { + }, + { "title": "Find out branches containing commit-hash", "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] -}, { + "alternatives": [ "git branch --contains " ] + }, + { "title": "Git Aliases", "tip": "git config --global alias. \ngit config --global alias.st status" -}, { + }, + { "title": "Saving current state of tracked files without commiting", "tip": "git stash", - "alternatives": ["git stash save"] -}, { + "alternatives": [ "git stash save" ] + }, + { "title": "Saving current state including untracked files", "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] -}, { + "alternatives": [ "git stash save --include-untracked" ] + }, + { "title": "Show list of all saved stashes", "tip": "git stash list" -}, { + }, + { "title": "Apply any stash without deleting from the stashed list", "tip": "git stash apply " -}, { + }, + { "title": "Apply last stashed state and delete it from stashed list", "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] -}, { + "alternatives": [ "git stash apply stash@{0} && git stash drop stash@{0}" ] + }, + { "title": "Delete all stored stashes", "tip": "git stash clear", - "alternatives": ["git stash drop "] -}, { + "alternatives": [ "git stash drop " ] + }, + { "title": "Grab a single file from a stash", "tip": "git checkout -- ", - "alternatives": ["git checkout stash@{0} -- "] -}, { + "alternatives": [ "git checkout stash@{0} -- " ] + }, + { "title": "Show all tracked files", "tip": "git ls-files -t" -}, { + }, + { "title": "Show all untracked files", "tip": "git ls-files --others" -}, { + }, + { "title": "Show all ignored files", "tip": "git ls-files --others -i --exclude-standard" -}, { + }, + { "title": "Create new working tree from a repository (git 2.5)", "tip": "git worktree add -b " -}, { + }, + { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" -}, { + }, + { "title": "Untrack files without deleting", "tip": "git rm --cached ", - "alternatives": ["git rm --cached -r "] -}, { + "alternatives": [ "git rm --cached -r " ] + }, + { "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" -}, { + }, + { "title": "Forcefully remove untracked files", "tip": "git clean -f" -}, { + }, + { "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", - "alternatives": ["git clean -df"] -}, { + "alternatives": [ "git clean -df" ] + }, + { "title": "Update all the submodules", "tip": "git submodule foreach git pull" -}, { + }, + { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] -}, { + "alternatives": [ "git cherry -v master " ] + }, + { "title": "Rename a branch", "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] -}, { + "alternatives": [ "git branch -m [] " ] + }, + { "title": "rebases 'feature' to 'master' and merges it in to master ", "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" -}, { + }, + { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" -}, { + }, + { "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" -}, { + }, + { "title": "Prunes references to remote branches that have been deleted in the remote.", "tip": "git fetch -p", - "alternatives": ["git remote prune origin"] -}, { + "alternatives": [ "git remote prune origin" ] + }, + { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1" -}, { + }, + { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": ["gitk --all"] -}, { + "alternatives": [ "gitk --all" ] + }, + { "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", "alternatives": "git subtree push --prefix subfolder_name origin branch_name" -}, { + }, + { "title": "Adding a project to repo using subtree", "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" -}, { + }, + { "title": "Get latest changes in your repo for a linked project using subtree", "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" -}, { + }, + { "title": "Export a branch with history to a file.", "tip": "git bundle create " -}, { + }, + { "title": "Import from a bundle", "tip": "git clone repo.bundle -b " -}, { + }, + { "title": "Get the name of current branch.", "tip": "git rev-parse --abbrev-ref HEAD" -}, { + }, + { "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" -}, { + }, + { "title": "Fetch pull request by ID to a local branch", "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] -}, { + "alternatives": [ "git pull origin pull//head:" ] + }, + { "title": "Show the most recent tag on the current branch.", "tip": "git describe --tags --abbrev=0" -}, { + }, + { "title": "Show inline word diff.", "tip": "git diff --word-diff" -}, { + }, + { "title": "Don’t consider changes for tracked file.", "tip": "git update-index --assume-unchanged " -}, { + }, + { "title": "Undo assume-unchanged.", "tip": "git update-index --no-assume-unchanged " -}, { + }, + { "title": "Clean the files from `.gitignore`.", "tip": "git clean -X -f" -}, { + }, + { "title": "Restore deleted file.", "tip": "git checkout ^ -- " -}, { + }, + { "title": "Restore file to a specific commit-hash", "tip": "git checkout -- " -}, { + }, + { "title": "Always rebase instead of merge on pull.", "tip": "git config --global branch.autosetuprebase always" -}, { + }, + { "title": "List all the alias and configs.", "tip": "git config --list" -}, { + }, + { "title": "Make git case sensitive.", "tip": "git config --global core.ignorecase false" -}, { + }, + { "title": "Auto correct typos.", "tip": "git config --global help.autocorrect 1" -}, { + }, + { "title": "Check if the change was a part of a release.", "tip": "git name-rev --name-only " -}, { + }, + { "title": "Dry run. (any command that supports dry-run flag should do.)", "tip": "git clean -fd --dry-run" -}, { + }, + { "title": "Marks your commit as a fix of a previous commit.", "tip": "git commit --fixup " -}, { + }, + { "title": "squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" -}, { + }, + { "title": "skip staging area during commit.", "tip": "git commit -am " -}, { + }, + { "title": "List ignored files.", "tip": "git check-ignore *" -}, { + }, + { "title": "Status of ignored files.", "tip": "git status --ignored" -}, { + }, + { "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" -}, { + }, + { "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip":"git config --global rerere.enabled 1" -}, { + "tip": "git config --global rerere.enabled 1" + }, + { "title": "Open all conflicted files in an editor.", "tip": "git diff --name-only | uniq | xargs $EDITOR" -}, { + }, + { "title": "Count unpacked number of objects and their disk consumption.", "tip": "git count-objects --human-readable" -}, { - "title": "Prune all unreachable objects from the object database.", - "tip": "git gc --prune=now --aggressive" -},{ - "title": "Instantly browse your working repository in gitweb.", - "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" -},{ - "title": "View the GPG signatures in the commit log", - "tip": "git log --show-signature" -}, { + }, + { + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" + }, + { + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" + }, + { + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" + }, + { "title": "Remove entry in the global config.", "tip": "git config --global --unset " -},{ + }, + { "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " -},{ - "title": "File diff between staging and the last file version.", - "tip": "git diff --staged" -},{ - "title": "Extract file from another branch.", - "tip": "git show :" -}, { - "title": "List only the root and merge commits.", - "tip": "git log --first-parent" -}, { - "title": "Merge previous two commits into one.", - "tip": "git rebase --interactive HEAD~2" -}, { - "title": "List all branch is WIP", - "tip": "git checkout master && git branch --no-merged" -}] + }, + { + "title": "File diff between staging and the last file version.", + "tip": "git diff --staged" + }, + { + "title": "Extract file from another branch.", + "tip": "git show :" + }, + { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" + }, + { + "title": "Merge previous two commits into one.", + "tip": "git rebase --interactive HEAD~2" + }, + { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" + }, + { + "title": "Find guilty with binary search", + "tip": "git bisect start\t\t\t\t# Search start \\ngit bisect bad\t\t\t\t\t# Set point to bad commit \\ngit bisect good v2.6.13-rc2\t\t# Set point to good commit|tag \\ngit bisect bad\t\t\t\t\t# Say current state is bad \\ngit bisect good\t\t\t\t\t# Say current state is good \\ngit bisect reset\t\t\t\t# Finish search \\n" + }] From e27d2a679259a180b5ebab6a5ab8619039c52b3d Mon Sep 17 00:00:00 2001 From: Alexander Pavlov Date: Tue, 7 Jun 2016 23:34:22 +0500 Subject: [PATCH 114/251] Return formatting --- tips.json | 373 ++++++++++++++++++++---------------------------------- 1 file changed, 136 insertions(+), 237 deletions(-) diff --git a/tips.json b/tips.json index 0fe33b5..7746fe5 100644 --- a/tips.json +++ b/tips.json @@ -1,421 +1,320 @@ -[ - { +[{ "title": "Everyday Git in twenty commands or so", "tip": "git help everyday" - }, - { +}, { "title": "Show helpful guides that come with Git", "tip": "git help -g" - }, - { +}, { "title": "Overwrite pull", "tip": "git fetch --all && git reset --hard origin/master" - }, - { +}, { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " - }, - { +}, { "title": "Git reset first commit", "tip": "git update-ref -d HEAD" - }, - { +}, { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" - }, - { +}, { "title": "List of all files changed in a commit", "tip": "git diff-tree --no-commit-id --name-only -r " - }, - { +}, { "title": "Unstaged changes since last commit", "tip": "git diff" - }, - { +}, { "title": "Changes staged for commit", "tip": "git diff --cached" - }, - { +}, { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" - }, - { +}, { "title": "List all branches that are already merged into master", "tip": "git checkout master && git branch --merged" - }, - { +}, { "title": "Quickly switch to the previous branch", "tip": "git checkout -" - }, - { +}, { "title": "Remove branches that have already been merged with master", "tip": "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" - }, - { +}, { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" - }, - { +}, { "title": "Track upstream branch", "tip": "git branch -u origin/mybranch" - }, - { +}, { "title": "Delete local branch", "tip": "git branch -d " - }, - { +}, { "title": "Delete remote branch", "tip": "git push origin --delete ", - "alternatives": [ "git push origin :" ] - }, - { + "alternatives": ["git push origin :"] +}, { "title": "Undo local changes with the last content in head", "tip": "git checkout -- " - }, - { +}, { "title": "Revert: Undo a commit by creating a new commit", "tip": "git revert " - }, - { +}, { "title": "Reset: Discard commits, advised for private branch", "tip": "git reset " - }, - { +}, { "title": "Reword the previous commit message", "tip": "git commit -v --amend" - }, - { +}, { "title": "Amend author.", "tip": "git commit --amend --author='Author Name '" - }, - { +}, { "title": "Reset author, after author has been changed in the global config.", "tip": "git commit --amend --reset-author --no-edit" - }, - { +}, { "title": "Changing a remote's URL", "tip": "git remote set-url origin " - }, - { +}, { "title": "Get list of all remote references", "tip": "git remote", - "alternatives": [ "git remote show" ] - }, - { + "alternatives": ["git remote show"] +}, { "title": "Get list of all local and remote branches", "tip": "git branch -a" - }, - { +}, { "title": "Get only remote branches", "tip": "git branch -r" - }, - { +}, { "title": "Stage parts of a changed file, instead of the entire file", "tip": "git add -p" - }, - { +}, { "title": "Get git bash completion", "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" - }, - { +}, { "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 && git cherry-pick " - }, - { +}, { "title": "Find out branches containing commit-hash", "tip": "git branch -a --contains ", - "alternatives": [ "git branch --contains " ] - }, - { + "alternatives": ["git branch --contains "] +}, { "title": "Git Aliases", "tip": "git config --global alias. \ngit config --global alias.st status" - }, - { +}, { "title": "Saving current state of tracked files without commiting", "tip": "git stash", - "alternatives": [ "git stash save" ] - }, - { + "alternatives": ["git stash save"] +}, { "title": "Saving current state including untracked files", "tip": "git stash save -u", - "alternatives": [ "git stash save --include-untracked" ] - }, - { + "alternatives": ["git stash save --include-untracked"] +}, { "title": "Show list of all saved stashes", "tip": "git stash list" - }, - { +}, { "title": "Apply any stash without deleting from the stashed list", "tip": "git stash apply " - }, - { +}, { "title": "Apply last stashed state and delete it from stashed list", "tip": "git stash pop", - "alternatives": [ "git stash apply stash@{0} && git stash drop stash@{0}" ] - }, - { + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] +}, { "title": "Delete all stored stashes", "tip": "git stash clear", - "alternatives": [ "git stash drop " ] - }, - { + "alternatives": ["git stash drop "] +}, { "title": "Grab a single file from a stash", "tip": "git checkout -- ", - "alternatives": [ "git checkout stash@{0} -- " ] - }, - { + "alternatives": ["git checkout stash@{0} -- "] +}, { "title": "Show all tracked files", "tip": "git ls-files -t" - }, - { +}, { "title": "Show all untracked files", "tip": "git ls-files --others" - }, - { +}, { "title": "Show all ignored files", "tip": "git ls-files --others -i --exclude-standard" - }, - { +}, { "title": "Create new working tree from a repository (git 2.5)", "tip": "git worktree add -b " - }, - { +}, { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" - }, - { +}, { "title": "Untrack files without deleting", "tip": "git rm --cached ", - "alternatives": [ "git rm --cached -r " ] - }, - { + "alternatives": ["git rm --cached -r "] +}, { "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" - }, - { +}, { "title": "Forcefully remove untracked files", "tip": "git clean -f" - }, - { +}, { "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", - "alternatives": [ "git clean -df" ] - }, - { + "alternatives": ["git clean -df"] +}, { "title": "Update all the submodules", "tip": "git submodule foreach git pull" - }, - { +}, { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", - "alternatives": [ "git cherry -v master " ] - }, - { + "alternatives": ["git cherry -v master "] +}, { "title": "Rename a branch", "tip": "git branch -m ", - "alternatives": [ "git branch -m [] " ] - }, - { + "alternatives": ["git branch -m [] "] +}, { "title": "rebases 'feature' to 'master' and merges it in to master ", "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" - }, - { +}, { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" - }, - { +}, { "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" - }, - { +}, { "title": "Prunes references to remote branches that have been deleted in the remote.", "tip": "git fetch -p", - "alternatives": [ "git remote prune origin" ] - }, - { + "alternatives": ["git remote prune origin"] +}, { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1" - }, - { +}, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": [ "gitk --all" ] - }, - { + "alternatives": ["gitk --all"] +}, { "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", "alternatives": "git subtree push --prefix subfolder_name origin branch_name" - }, - { +}, { "title": "Adding a project to repo using subtree", "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" - }, - { +}, { "title": "Get latest changes in your repo for a linked project using subtree", "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" - }, - { +}, { "title": "Export a branch with history to a file.", "tip": "git bundle create " - }, - { +}, { "title": "Import from a bundle", "tip": "git clone repo.bundle -b " - }, - { +}, { "title": "Get the name of current branch.", "tip": "git rev-parse --abbrev-ref HEAD" - }, - { +}, { "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" - }, - { +}, { "title": "Fetch pull request by ID to a local branch", "tip": "git fetch origin pull//head:", - "alternatives": [ "git pull origin pull//head:" ] - }, - { + "alternatives": ["git pull origin pull//head:"] +}, { "title": "Show the most recent tag on the current branch.", "tip": "git describe --tags --abbrev=0" - }, - { +}, { "title": "Show inline word diff.", "tip": "git diff --word-diff" - }, - { +}, { "title": "Don’t consider changes for tracked file.", "tip": "git update-index --assume-unchanged " - }, - { +}, { "title": "Undo assume-unchanged.", "tip": "git update-index --no-assume-unchanged " - }, - { +}, { "title": "Clean the files from `.gitignore`.", "tip": "git clean -X -f" - }, - { +}, { "title": "Restore deleted file.", "tip": "git checkout ^ -- " - }, - { +}, { "title": "Restore file to a specific commit-hash", "tip": "git checkout -- " - }, - { +}, { "title": "Always rebase instead of merge on pull.", "tip": "git config --global branch.autosetuprebase always" - }, - { +}, { "title": "List all the alias and configs.", "tip": "git config --list" - }, - { +}, { "title": "Make git case sensitive.", "tip": "git config --global core.ignorecase false" - }, - { +}, { "title": "Auto correct typos.", "tip": "git config --global help.autocorrect 1" - }, - { +}, { "title": "Check if the change was a part of a release.", "tip": "git name-rev --name-only " - }, - { +}, { "title": "Dry run. (any command that supports dry-run flag should do.)", "tip": "git clean -fd --dry-run" - }, - { +}, { "title": "Marks your commit as a fix of a previous commit.", "tip": "git commit --fixup " - }, - { +}, { "title": "squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" - }, - { +}, { "title": "skip staging area during commit.", "tip": "git commit -am " - }, - { +}, { "title": "List ignored files.", "tip": "git check-ignore *" - }, - { +}, { "title": "Status of ignored files.", "tip": "git status --ignored" - }, - { +}, { "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" - }, - { +}, { "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip": "git config --global rerere.enabled 1" - }, - { + "tip":"git config --global rerere.enabled 1" +}, { "title": "Open all conflicted files in an editor.", "tip": "git diff --name-only | uniq | xargs $EDITOR" - }, - { +}, { "title": "Count unpacked number of objects and their disk consumption.", "tip": "git count-objects --human-readable" - }, - { - "title": "Prune all unreachable objects from the object database.", - "tip": "git gc --prune=now --aggressive" - }, - { - "title": "Instantly browse your working repository in gitweb.", - "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" - }, - { - "title": "View the GPG signatures in the commit log", - "tip": "git log --show-signature" - }, - { +}, { + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" +},{ + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" +},{ + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" +}, { "title": "Remove entry in the global config.", "tip": "git config --global --unset " - }, - { +},{ "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " - }, - { - "title": "File diff between staging and the last file version.", - "tip": "git diff --staged" - }, - { - "title": "Extract file from another branch.", - "tip": "git show :" - }, - { - "title": "List only the root and merge commits.", - "tip": "git log --first-parent" - }, - { - "title": "Merge previous two commits into one.", - "tip": "git rebase --interactive HEAD~2" - }, - { - "title": "List all branch is WIP", - "tip": "git checkout master && git branch --no-merged" - }, - { - "title": "Find guilty with binary search", - "tip": "git bisect start\t\t\t\t# Search start \\ngit bisect bad\t\t\t\t\t# Set point to bad commit \\ngit bisect good v2.6.13-rc2\t\t# Set point to good commit|tag \\ngit bisect bad\t\t\t\t\t# Say current state is bad \\ngit bisect good\t\t\t\t\t# Say current state is good \\ngit bisect reset\t\t\t\t# Finish search \\n" - }] +},{ + "title": "File diff between staging and the last file version.", + "tip": "git diff --staged" +},{ + "title": "Extract file from another branch.", + "tip": "git show :" +}, { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" +}, { + "title": "Merge previous two commits into one.", + "tip": "git rebase --interactive HEAD~2" +}, { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" +}, { + "title": "Find guilty with binary search", + "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" +}] From 9b268214bea34c63da56d979d302e47facc0d9ce Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Tue, 7 Jun 2016 10:51:11 +0530 Subject: [PATCH 115/251] Bypass githooks --- README.md | 6 ++++++ tips.json | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b7b7efb..2ba7e55 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Merge previous two commits into one.](#merge-previous-two-commits-into-one) * [List all branch is WIP](#list-all-branch-is-wip) * [Find guilty with binary search](#find-guilty-with-binary-search) +* [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) @@ -715,5 +716,10 @@ git bisect good # Say current state is good git bisect reset # Finish search ``` +## Bypass pre-commit and commit-msg githooks +```sh +git commit --no-verify +``` + diff --git a/tips.json b/tips.json index 7746fe5..c6b2fd3 100644 --- a/tips.json +++ b/tips.json @@ -317,4 +317,8 @@ }, { "title": "Find guilty with binary search", "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" -}] +}, + { + "title": "Bypass pre-commit and commit-msg githooks", + "tip": "git commit --no-verify" + }] From 160fa86460bb8df8814fd952fc03953116179e97 Mon Sep 17 00:00:00 2001 From: Olga Brani Date: Tue, 7 Jun 2016 11:03:26 +0300 Subject: [PATCH 116/251] MINOR: Fix typo --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7b7efb..b823be0 100644 --- a/README.md +++ b/README.md @@ -686,7 +686,7 @@ git diff --staged ## Extract file from another branch. ```sh -git show : +git show : ``` ## List only the root and merge commits. diff --git a/tips.json b/tips.json index 7746fe5..22d6877 100644 --- a/tips.json +++ b/tips.json @@ -304,7 +304,7 @@ "tip": "git diff --staged" },{ "title": "Extract file from another branch.", - "tip": "git show :" + "tip": "git show :" }, { "title": "List only the root and merge commits.", "tip": "git log --first-parent" From c49409830a159e6fa497eaff14ee7c7f6772fef6 Mon Sep 17 00:00:00 2001 From: David-Wobrock Date: Wed, 8 Jun 2016 22:00:17 +0200 Subject: [PATCH 117/251] Formatting tabs into spaces. Doxie throws errors like '[doxie] Invalid JSON input: "Unexpected token in JSON at position 11987"' otherwise --- README.md | 14 ++++++------- tips.json | 59 +++++++++++++++++++++++++++---------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 73f9d30..a284765 100644 --- a/README.md +++ b/README.md @@ -706,14 +706,14 @@ git checkout master && git branch --no-merged ``` ## Find guilty with binary search - ```sh -git bisect start # Search start -git bisect bad # Set point to bad commit -git bisect good v2.6.13-rc2 # Set point to good commit|tag -git bisect bad # Say current state is bad -git bisect good # Say current state is good -git bisect reset # Finish search +git bisect start # Search start +git bisect bad # Set point to bad commit +git bisect good v2.6.13-rc2 # Set point to good commit|tag +git bisect bad # Say current state is bad +git bisect good # Say current state is good +git bisect reset # Finish search + ``` ## Bypass pre-commit and commit-msg githooks diff --git a/tips.json b/tips.json index 9f26e04..5d804b7 100644 --- a/tips.json +++ b/tips.json @@ -285,40 +285,39 @@ "title": "Count unpacked number of objects and their disk consumption.", "tip": "git count-objects --human-readable" }, { - "title": "Prune all unreachable objects from the object database.", - "tip": "git gc --prune=now --aggressive" -},{ - "title": "Instantly browse your working repository in gitweb.", - "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" -},{ - "title": "View the GPG signatures in the commit log", - "tip": "git log --show-signature" + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" +}, { + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" +}, { + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" }, { "title": "Remove entry in the global config.", "tip": "git config --global --unset " -},{ +}, { "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " -},{ - "title": "File diff between staging and the last file version.", - "tip": "git diff --staged" -},{ - "title": "Extract file from another branch.", - "tip": "git show :" -}, { - "title": "List only the root and merge commits.", - "tip": "git log --first-parent" -}, { - "title": "Merge previous two commits into one.", - "tip": "git rebase --interactive HEAD~2" -}, { - "title": "List all branch is WIP", - "tip": "git checkout master && git branch --no-merged" -}, { - "title": "Find guilty with binary search", - "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" -}, - { +}, { + "title": "File diff between staging and the last file version.", + "tip": "git diff --staged" +}, { + "title": "Extract file from another branch.", + "tip": "git show :" +}, { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" +}, { + "title": "Merge previous two commits into one.", + "tip": "git rebase --interactive HEAD~2" +}, { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" +}, { + "title": "Find guilty with binary search", + "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" +}, { "title": "Bypass pre-commit and commit-msg githooks", "tip": "git commit --no-verify" - }] +}] From 9eae0f3cc423bb5f6e58e6dc542ade602b34c6bf Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Wed, 8 Jun 2016 22:47:21 +0200 Subject: [PATCH 118/251] Update README and TOC ... by `npm run-script generate` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2af0e2d..d58eedf 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ git diff HEAD ## List all branches that are already merged into master ```sh -git checkout master && git branch --merged +git branch --merged master ``` ## Quickly switch to the previous branch From 65dd8ac36f1dde3a542ce894a16611e9f6b0c67e Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Wed, 8 Jun 2016 22:49:04 +0200 Subject: [PATCH 119/251] Update README and TOC ... by `npm run-script generate` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2af0e2d..117af3a 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ git checkout - ## Remove branches that have already been merged with master ```sh -git branch --merged | grep -v '\*' | xargs -n 1 git branch -d +git branch --merged master | grep -v '^\*' | xargs --no-run-if-empty -n 1 git branch -d ``` ## List all branches and their upstreams, as well as last commit on branch From f9772a90df5f64f1331c6211a5779e3a9773821c Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Wed, 8 Jun 2016 22:51:47 +0200 Subject: [PATCH 120/251] Update README and TOC ... by `npm run-script generate` --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2af0e2d..6b466bb 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,12 @@ curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completio ## What changed since two weeks? ```sh +git log --no-merges --raw --since='2 weeks ago' +``` + + +__Alternatives:__ +```sh git whatchanged --since='2 weeks ago' ``` From cc2f616e566a1fa964d18b43ef11f3598092d9a0 Mon Sep 17 00:00:00 2001 From: David-Wobrock Date: Wed, 8 Jun 2016 22:54:04 +0200 Subject: [PATCH 121/251] Add tip for tracing all changes made to a file --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a284765..b7ae31d 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List all branch is WIP](#list-all-branch-is-wip) * [Find guilty with binary search](#find-guilty-with-binary-search) * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) +* [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) @@ -721,5 +722,10 @@ git bisect reset # Finish search git commit --no-verify ``` +## List commits and changes to a specific file (even through renaming) +```sh +git log --follow -p -- +``` + diff --git a/tips.json b/tips.json index 5d804b7..0f82f57 100644 --- a/tips.json +++ b/tips.json @@ -277,7 +277,7 @@ "tip": "git log Branch1 ^Branch2" }, { "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip":"git config --global rerere.enabled 1" + "tip": "git config --global rerere.enabled 1" }, { "title": "Open all conflicted files in an editor.", "tip": "git diff --name-only | uniq | xargs $EDITOR" @@ -320,4 +320,7 @@ }, { "title": "Bypass pre-commit and commit-msg githooks", "tip": "git commit --no-verify" +}, { + "title": "List commits and changes to a specific file (even through renaming)", + "tip": "git log --follow -p -- " }] From 221dae08ad66329deafeb521a70fe3f6f12b65d7 Mon Sep 17 00:00:00 2001 From: Ali Servet Donmez Date: Wed, 8 Jun 2016 23:00:07 +0200 Subject: [PATCH 122/251] Emphasize to install dependencies --- contributing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contributing.md b/contributing.md index a30ea54..f3bc85e 100644 --- a/contributing.md +++ b/contributing.md @@ -7,6 +7,8 @@ $ cd tips && npm install ``` + :warning: don't fail to think that this is optional, because if you don't install the dependencies you won't get the benefit of auto-updating README and TOC and your PR will likely to not get merged because of that. + * Edit [tips.json](./tips.json) to add your tip in the below format: ```js From 3bd8fae29b65fd2bcdefa79388d2d6ab5412c618 Mon Sep 17 00:00:00 2001 From: Kadi Kraman Date: Thu, 9 Jun 2016 09:56:45 +0100 Subject: [PATCH 123/251] Remove --no-run-if-empty flag --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 582c32d..f252c9c 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ git checkout - ## Remove branches that have already been merged with master ```sh -git branch --merged master | grep -v '^\*' | xargs --no-run-if-empty -n 1 git branch -d +git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d ``` ## List all branches and their upstreams, as well as last commit on branch diff --git a/tips.json b/tips.json index 6f90fca..01f8c34 100644 --- a/tips.json +++ b/tips.json @@ -36,7 +36,7 @@ "tip": "git checkout -" }, { "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged master | grep -v '^\\*' | xargs --no-run-if-empty -n 1 git branch -d" + "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d" }, { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" From d7e4e4a422de96a0eb220c231a49ba844ddbbc41 Mon Sep 17 00:00:00 2001 From: ank91 Date: Fri, 10 Jun 2016 16:10:16 +0530 Subject: [PATCH 124/251] Add clone single branch command --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 582c32d..8dbae51 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Find guilty with binary search](#find-guilty-with-binary-search) * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) * [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) +* [Clone a single branch](#clone-a-single-branch) @@ -733,5 +734,10 @@ git commit --no-verify git log --follow -p -- ``` +## Clone a single branch +```sh +git clone -b --single-branch https://github.com/user/repo.git +``` + diff --git a/tips.json b/tips.json index 6f90fca..e2744b9 100644 --- a/tips.json +++ b/tips.json @@ -324,4 +324,7 @@ }, { "title": "List commits and changes to a specific file (even through renaming)", "tip": "git log --follow -p -- " +},{ + "title": "Clone a single branch", + "tip": "git clone -b --single-branch https://github.com/user/repo.git" }] From 6209b8ba859ea869aa0dd8c89d4b3d12ea8f2da9 Mon Sep 17 00:00:00 2001 From: Martin Tamashiro Date: Sat, 11 Jun 2016 14:59:23 -0300 Subject: [PATCH 125/251] Ignore file mode changes on commits --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index c0ff4c9..bf29687 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) * [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) * [Clone a single branch](#clone-a-single-branch) +* [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) @@ -739,5 +740,10 @@ git log --follow -p -- git clone -b --single-branch https://github.com/user/repo.git ``` +## Ignore file mode changes on commits +```sh +git config core.fileMode false +``` + diff --git a/tips.json b/tips.json index 8601f54..beeb746 100644 --- a/tips.json +++ b/tips.json @@ -327,4 +327,7 @@ },{ "title": "Clone a single branch", "tip": "git clone -b --single-branch https://github.com/user/repo.git" +},{ + "title": "Ignore file mode changes on commits", + "tip": "git config core.fileMode false" }] From e7fe458e79a4ef37f76d3a931be67e51c75adbef Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Sun, 12 Jun 2016 12:38:00 +0530 Subject: [PATCH 126/251] GNU GENERAL PUBLIC LICENSE ^ --- license.md | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 license.md diff --git a/license.md b/license.md new file mode 100644 index 0000000..a356064 --- /dev/null +++ b/license.md @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2016 Hemanth.HM [https://h3manth.com] + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From 1e2a0e10fb68159dfe8e713189f1373e727e8632 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Sun, 12 Jun 2016 12:38:16 +0530 Subject: [PATCH 127/251] Delete license.md --- license.md | 674 ----------------------------------------------------- 1 file changed, 674 deletions(-) delete mode 100644 license.md diff --git a/license.md b/license.md deleted file mode 100644 index a356064..0000000 --- a/license.md +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2016 Hemanth.HM [https://h3manth.com] - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. From b7c0a19ded52dd336af30fdc0a84b5ca0a84dcd1 Mon Sep 17 00:00:00 2001 From: denisbalyko Date: Sun, 12 Jun 2016 11:10:42 +0300 Subject: [PATCH 128/251] Added git checkout -b --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index bf29687..24bf42f 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) * [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) * [Clone a single branch](#clone-a-single-branch) +* [Create and switch new branch](#create-and-switch-new-branch) * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) @@ -740,6 +741,11 @@ git log --follow -p -- git clone -b --single-branch https://github.com/user/repo.git ``` +## Create and switch new branch +```sh +git checkout -b +``` + ## Ignore file mode changes on commits ```sh git config core.fileMode false diff --git a/tips.json b/tips.json index beeb746..b17022d 100644 --- a/tips.json +++ b/tips.json @@ -327,6 +327,9 @@ },{ "title": "Clone a single branch", "tip": "git clone -b --single-branch https://github.com/user/repo.git" +},{ + "title": "Create and switch new branch", + "tip": "git checkout -b " },{ "title": "Ignore file mode changes on commits", "tip": "git config core.fileMode false" From c147aa64e21080a823d51217542ac1ebe973d11a Mon Sep 17 00:00:00 2001 From: Ranhiru Cooray Date: Sun, 12 Jun 2016 19:53:00 +0800 Subject: [PATCH 129/251] Added git diff --staged to be synonym for git diff --cached --- README.md | 8 +------- tips.json | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bf29687..f09d3a0 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,6 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log) * [Remove entry in the global config.](#remove-entry-in-the-global-config) * [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history) -* [File diff between staging and the last file version.](#file-diff-between-staging-and-the-last-file-version) * [Extract file from another branch.](#extract-file-from-another-branch) * [List only the root and merge commits.](#list-only-the-root-and-merge-commits) * [Merge previous two commits into one.](#merge-previous-two-commits-into-one) @@ -159,7 +158,7 @@ git diff ## Changes staged for commit ```sh -git diff --cached +git diff --cached or git diff --staged ``` ## Show both staged and unstaged changes @@ -689,11 +688,6 @@ git config --global --unset git checkout --orphan ``` -## File diff between staging and the last file version. -```sh -git diff --staged -``` - ## Extract file from another branch. ```sh git show : diff --git a/tips.json b/tips.json index beeb746..0c06687 100644 --- a/tips.json +++ b/tips.json @@ -24,7 +24,7 @@ "tip": "git diff" }, { "title": "Changes staged for commit", - "tip": "git diff --cached" + "tip": "git diff --cached or git diff --staged" }, { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" @@ -300,9 +300,6 @@ }, { "title": "Checkout a new branch without any history", "tip": "git checkout --orphan " -}, { - "title": "File diff between staging and the last file version.", - "tip": "git diff --staged" }, { "title": "Extract file from another branch.", "tip": "git show :" From 32f2a4af3589f4d0844392add0dd23212c28c246 Mon Sep 17 00:00:00 2001 From: Ranhiru Cooray Date: Sun, 12 Jun 2016 22:41:16 +0800 Subject: [PATCH 130/251] Added --staged as an alternative --- README.md | 2 +- tips.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f09d3a0..3305e9a 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ git diff ## Changes staged for commit ```sh -git diff --cached or git diff --staged +git diff --cached ``` ## Show both staged and unstaged changes diff --git a/tips.json b/tips.json index 0c06687..d0ceb86 100644 --- a/tips.json +++ b/tips.json @@ -24,7 +24,8 @@ "tip": "git diff" }, { "title": "Changes staged for commit", - "tip": "git diff --cached or git diff --staged" + "tip": "git diff --cached", + "alternatives": "git diff --staged" }, { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" From 1ff31a939fe3c9ac5cf6dbdf3495527a5aec3214 Mon Sep 17 00:00:00 2001 From: Ranhiru Cooray Date: Mon, 13 Jun 2016 19:47:46 +0800 Subject: [PATCH 131/251] Added alternative as an array --- README.md | 6 ++++++ tips.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3305e9a..47b2a6f 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,12 @@ git diff git diff --cached ``` + +__Alternatives:__ +```sh +git diff --staged +``` + ## Show both staged and unstaged changes ```sh git diff HEAD diff --git a/tips.json b/tips.json index d0ceb86..36448ec 100644 --- a/tips.json +++ b/tips.json @@ -25,7 +25,7 @@ }, { "title": "Changes staged for commit", "tip": "git diff --cached", - "alternatives": "git diff --staged" + "alternatives": ["git diff --staged"] }, { "title": "Show both staged and unstaged changes", "tip": "git diff HEAD" From 223f430e1e8fad11ea132c8f8eed717c6aae9e19 Mon Sep 17 00:00:00 2001 From: andela-djames Date: Mon, 13 Jun 2016 15:00:11 +0100 Subject: [PATCH 132/251] Add tips for changing git terminal output color settings --- README.md | 12 ++++++++++++ tips.json | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 24bf42f..bef5dc3 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,8 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Clone a single branch](#clone-a-single-branch) * [Create and switch new branch](#create-and-switch-new-branch) * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) +* [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) +* [specific color settings](#specific-color-settings) @@ -751,5 +753,15 @@ git checkout -b git config core.fileMode false ``` +## Turn off git colored terminal output +```sh +git config --global color.ui false +``` + +## specific color settings +```sh +git config --global +``` + diff --git a/tips.json b/tips.json index b17022d..9048deb 100644 --- a/tips.json +++ b/tips.json @@ -333,4 +333,10 @@ },{ "title": "Ignore file mode changes on commits", "tip": "git config core.fileMode false" +},{ + "title": "Turn off git colored terminal output", + "tip": "git config --global color.ui false" +},{ + "title": "specific color settings", + "tip": "git config --global " }] From 15698a4e2092d8fd0f3000c5016046645dfdb13e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 13 Jun 2016 12:36:12 -0400 Subject: [PATCH 133/251] Added another git command --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 24bf42f..646df2f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit) * [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch) * [Reword the previous commit message](#reword-the-previous-commit-message) +* [See commit history for just the current branch](#see-commit-history-for-just-the-current-branch) * [Amend author.](#amend-author) * [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config) * [Changing a remote's URL](#changing-a-remotes-url) @@ -229,6 +230,11 @@ git reset git commit -v --amend ``` +## See commit history for just the current branch +```sh +git cherry -v master +``` + ## Amend author. ```sh git commit --amend --author='Author Name ' diff --git a/tips.json b/tips.json index b17022d..9edd7a7 100644 --- a/tips.json +++ b/tips.json @@ -62,6 +62,9 @@ }, { "title": "Reword the previous commit message", "tip": "git commit -v --amend" +}, { + "title": "See commit history for just the current branch", + "tip": "git cherry -v master" }, { "title": "Amend author.", "tip": "git commit --amend --author='Author Name '" From 0558db872b886d41142460b6f078c6d24c5561dc Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Mon, 13 Jun 2016 23:00:07 +0530 Subject: [PATCH 134/251] Adds alternatives to create and switch branch --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39bc453..752b63f 100644 --- a/README.md +++ b/README.md @@ -746,6 +746,12 @@ git clone -b --single-branch https://github.com/user/repo.git git checkout -b ``` + +__Alternatives:__ +```sh +git branch && git checkout +``` + ## Ignore file mode changes on commits ```sh git config core.fileMode false diff --git a/tips.json b/tips.json index a073925..7d1daa2 100644 --- a/tips.json +++ b/tips.json @@ -327,7 +327,8 @@ "tip": "git clone -b --single-branch https://github.com/user/repo.git" },{ "title": "Create and switch new branch", - "tip": "git checkout -b " + "tip": "git checkout -b ", + "alternatives": ["git branch && git checkout "] },{ "title": "Ignore file mode changes on commits", "tip": "git config core.fileMode false" From 4efcd6cff6ca22bca40e4ab170ffe51f2ea15e7f Mon Sep 17 00:00:00 2001 From: "Schumacher, Jeffrey" Date: Mon, 13 Jun 2016 11:17:54 -0700 Subject: [PATCH 135/251] Adding alternative to deleting branches merged to master that will not delete master itself --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39bc453..fee81cd 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,12 @@ git checkout - git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d ``` + +__Alternatives:__ +```sh +git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out +``` + ## List all branches and their upstreams, as well as last commit on branch ```sh git branch -vv diff --git a/tips.json b/tips.json index a073925..89473bd 100644 --- a/tips.json +++ b/tips.json @@ -37,7 +37,8 @@ "tip": "git checkout -" }, { "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d" + "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", + "alternatives": ["git branch --merged master | grep -v '^\\*\\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out"] }, { "title": "List all branches and their upstreams, as well as last commit on branch", "tip": "git branch -vv" From bdad5790be077c58e5e0a8c38498bb87560b592f Mon Sep 17 00:00:00 2001 From: Aditya Harsh Date: Thu, 16 Jun 2016 14:16:41 +0530 Subject: [PATCH 136/251] Add custom editor --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 1730796..e9c6062 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull) * [List all the alias and configs.](#list-all-the-alias-and-configs) * [Make git case sensitive.](#make-git-case-sensitive) +* [Add custom editors.](#add-custom-editors) * [Auto correct typos.](#auto-correct-typos) * [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release) * [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do) @@ -624,6 +625,11 @@ git config --list git config --global core.ignorecase false ``` +## Add custom editors. +```sh + git config --global core.editor '$EDITOR' +``` + ## Auto correct typos. ```sh git config --global help.autocorrect 1 diff --git a/tips.json b/tips.json index 6034145..eff5643 100644 --- a/tips.json +++ b/tips.json @@ -254,6 +254,9 @@ }, { "title": "Make git case sensitive.", "tip": "git config --global core.ignorecase false" +},{ + "title": "Add custom editors.", + "tip": "git config --global core.editor '$EDITOR'" }, { "title": "Auto correct typos.", "tip": "git config --global help.autocorrect 1" From e22b7b17d509ef7b0a74944df30d73c6ed55eca3 Mon Sep 17 00:00:00 2001 From: Pratyush Date: Thu, 16 Jun 2016 15:19:33 +0530 Subject: [PATCH 137/251] Add tip to show recently updated branches --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 1730796..72c1c89 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) * [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) * [specific color settings](#specific-color-settings) +* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) @@ -781,5 +782,10 @@ git config --global color.ui false git config --global ``` +## Show all local branches ordered by recent commits +```sh +git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ +``` + diff --git a/tips.json b/tips.json index 6034145..81ce8d4 100644 --- a/tips.json +++ b/tips.json @@ -342,4 +342,7 @@ },{ "title": "specific color settings", "tip": "git config --global " +},{ + "title": "Show all local branches ordered by recent commits", + "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" }] From 221aa76eec7bc049099f57e6d6f9e9afa4c0c4b9 Mon Sep 17 00:00:00 2001 From: scriptype Date: Fri, 17 Jun 2016 02:58:38 +0300 Subject: [PATCH 138/251] Add git grep --- README.md | 8 +++++++- tips.json | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3e88a3..c0c6d4f 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) * [specific color settings](#specific-color-settings) * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) +* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) @@ -628,7 +629,7 @@ git config --global core.ignorecase false ## Add custom editors. ```sh - git config --global core.editor '$EDITOR' +git config --global core.editor '$EDITOR' ``` ## Auto correct typos. @@ -793,5 +794,10 @@ git config --global git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ ``` +## Find lines matching the pattern (regex or string) in tracked files +```sh +git grep --heading --line-number 'foo bar' +``` + diff --git a/tips.json b/tips.json index f69c476..0678b6b 100644 --- a/tips.json +++ b/tips.json @@ -348,4 +348,7 @@ },{ "title": "Show all local branches ordered by recent commits", "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" +},{ + "title": "Find lines matching the pattern (regex or string) in tracked files", + "tip": "git grep --heading --line-number 'foo bar'" }] From 474262b119b45504c2e77f6b4f1588e30239aa2e Mon Sep 17 00:00:00 2001 From: Marc Beuret Date: Fri, 17 Jun 2016 12:56:27 +0200 Subject: [PATCH 139/251] Add tip to delete local and remote tag --- README.md | 14 +++++++++++++- tips.json | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3e88a3..d144cd9 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Track upstream branch](#track-upstream-branch) * [Delete local branch](#delete-local-branch) * [Delete remote branch](#delete-remote-branch) +* [Delete local tag](#delete-local-tag) +* [Delete remote tag](#delete-remote-tag) * [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head) * [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit) * [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch) @@ -225,6 +227,16 @@ __Alternatives:__ git push origin : ``` +## Delete local tag +```sh +git tag -d +``` + +## Delete remote tag +```sh +git push origin :refs/tags/ +``` + ## Undo local changes with the last content in head ```sh git checkout -- @@ -628,7 +640,7 @@ git config --global core.ignorecase false ## Add custom editors. ```sh - git config --global core.editor '$EDITOR' +git config --global core.editor '$EDITOR' ``` ## Auto correct typos. diff --git a/tips.json b/tips.json index f69c476..b564978 100644 --- a/tips.json +++ b/tips.json @@ -52,6 +52,12 @@ "title": "Delete remote branch", "tip": "git push origin --delete ", "alternatives": ["git push origin :"] +}, { + "title": "Delete local tag", + "tip": "git tag -d " +}, { + "title": "Delete remote tag", + "tip": "git push origin :refs/tags/" }, { "title": "Undo local changes with the last content in head", "tip": "git checkout -- " From ca7e782a9f72eea4f3656e6073a1a0d095c6f5e8 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Fri, 17 Jun 2016 15:31:08 +0000 Subject: [PATCH 140/251] Add tip for shallow copy --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 238417c..134ae6b 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [specific color settings](#specific-color-settings) * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) * [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) +* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) @@ -811,5 +812,10 @@ git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ git grep --heading --line-number 'foo bar' ``` +## Clone a shallow copy of a repository +```sh +git clone https://github.com/user/repo.git --depth 1 +``` + diff --git a/tips.json b/tips.json index c247ecc..b25f127 100644 --- a/tips.json +++ b/tips.json @@ -357,4 +357,7 @@ },{ "title": "Find lines matching the pattern (regex or string) in tracked files", "tip": "git grep --heading --line-number 'foo bar'" -}] +}, { + "title": "Clone a shallow copy of a repository", + "tip": "git clone https://github.com/user/repo.git --depth 1" +}] \ No newline at end of file From 9d905ac6d14ea8b1acf7e9f48dde5a3f810e4fd8 Mon Sep 17 00:00:00 2001 From: denisbalyko Date: Sat, 18 Jun 2016 12:42:31 +0300 Subject: [PATCH 141/251] added alternative update submodules --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 24bf42f..5c0c554 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,12 @@ git clean -df git submodule foreach git pull ``` + +__Alternatives:__ +```sh +git submodule update --init --recursive +``` + ## Show all commits in the current branch yet to be merged to master ```sh git cherry -v master diff --git a/tips.json b/tips.json index b17022d..8835b63 100644 --- a/tips.json +++ b/tips.json @@ -161,7 +161,8 @@ "alternatives": ["git clean -df"] }, { "title": "Update all the submodules", - "tip": "git submodule foreach git pull" + "tip": "git submodule foreach git pull", + "alternatives": ["git submodule update --init --recursive"] }, { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", From 7cfb00247408351386c2c87bb14e309ece6b4b1f Mon Sep 17 00:00:00 2001 From: denisbalyko Date: Sat, 18 Jun 2016 12:44:05 +0300 Subject: [PATCH 142/251] fix indent --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 8835b63..e8302d2 100644 --- a/tips.json +++ b/tips.json @@ -162,7 +162,7 @@ }, { "title": "Update all the submodules", "tip": "git submodule foreach git pull", - "alternatives": ["git submodule update --init --recursive"] + "alternatives": ["git submodule update --init --recursive"] }, { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", From a5db8297085b8e2068398b095c8e3c53febcf05d Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sat, 18 Jun 2016 19:58:58 +0530 Subject: [PATCH 143/251] Add tip to search commit log --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b06c387..9e1d253 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) * [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) * [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) +* [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) @@ -823,5 +824,10 @@ git grep --heading --line-number 'foo bar' git clone https://github.com/user/repo.git --depth 1 ``` +## Search Commit log across all branches for given text +```sh +git log --all --grep='' +``` + diff --git a/tips.json b/tips.json index acfcf78..a6f8918 100644 --- a/tips.json +++ b/tips.json @@ -361,4 +361,7 @@ }, { "title": "Clone a shallow copy of a repository", "tip": "git clone https://github.com/user/repo.git --depth 1" -}] \ No newline at end of file +}, { + "title": "Search Commit log across all branches for given text", + "tip": "git log --all --grep=''" +}] From b096219f3106d96a8e78d38f5c9a4fc12467a0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20F=C3=A9lizard?= Date: Sat, 18 Jun 2016 09:43:34 +0000 Subject: [PATCH 144/251] Add alternative to update submodules --- README.md | 5 +++++ tips.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b06c387..fa7c93d 100644 --- a/README.md +++ b/README.md @@ -481,6 +481,11 @@ __Alternatives:__ git submodule update --init --recursive ``` + +```sh +git submodule update --remote +``` + ## Show all commits in the current branch yet to be merged to master ```sh git cherry -v master diff --git a/tips.json b/tips.json index acfcf78..571cd52 100644 --- a/tips.json +++ b/tips.json @@ -173,7 +173,7 @@ }, { "title": "Update all the submodules", "tip": "git submodule foreach git pull", - "alternatives": ["git submodule update --init --recursive"] + "alternatives": ["git submodule update --init --recursive", "git submodule update --remote"] }, { "title": "Show all commits in the current branch yet to be merged to master", "tip": "git cherry -v master", @@ -361,4 +361,4 @@ }, { "title": "Clone a shallow copy of a repository", "tip": "git clone https://github.com/user/repo.git --depth 1" -}] \ No newline at end of file +}] From 614e5a9638a169ee652d9731d895d653b3baba4e Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sun, 19 Jun 2016 20:40:54 +0530 Subject: [PATCH 145/251] resolve merge conflict --- tips.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/tips.json b/tips.json index 8eb7c56..5d31a3a 100644 --- a/tips.json +++ b/tips.json @@ -361,10 +361,7 @@ }, { "title": "Clone a shallow copy of a repository", "tip": "git clone https://github.com/user/repo.git --depth 1" -<<<<<<< HEAD }, { "title": "Search Commit log across all branches for given text", "tip": "git log --all --grep=''" -======= ->>>>>>> 93e25eb7185e0e98398a170126f9395f26096798 }] From 418b227c124a3082eeb3d7547cf1589e20528a58 Mon Sep 17 00:00:00 2001 From: Jorge Marin Date: Sun, 19 Jun 2016 19:50:21 +0200 Subject: [PATCH 146/251] Add tip for first commit in a branch --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fa7c93d..cbab932 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) * [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) * [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) +* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) @@ -828,5 +829,10 @@ git grep --heading --line-number 'foo bar' git clone https://github.com/user/repo.git --depth 1 ``` +## Get first commit in a branch (from master) +```sh +git log master.. --oneline | tail -1 +``` + diff --git a/tips.json b/tips.json index 571cd52..bc5a7dc 100644 --- a/tips.json +++ b/tips.json @@ -361,4 +361,7 @@ }, { "title": "Clone a shallow copy of a repository", "tip": "git clone https://github.com/user/repo.git --depth 1" +}, { + "title": "Get first commit in a branch (from master)", + "tip": "git log master.. --oneline | tail -1" }] From f9c84b6c61160c56b9085daf1d6644210dde614a Mon Sep 17 00:00:00 2001 From: Aditya Harsh Date: Wed, 22 Jun 2016 15:25:18 +0530 Subject: [PATCH 147/251] Add Interactive staging --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 887d0a1..4bbde61 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit) * [squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) * [skip staging area during commit.](#skip-staging-area-during-commit) +* [Interactive staging.](#interactive-staging) * [List ignored files.](#list-ignored-files) * [Status of ignored files.](#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) @@ -688,6 +689,11 @@ git rebase -i --autosquash git commit -am ``` +## Interactive staging. +```sh +git add -i +``` + ## List ignored files. ```sh git check-ignore * diff --git a/tips.json b/tips.json index 4cb4cce..e8c6753 100644 --- a/tips.json +++ b/tips.json @@ -282,6 +282,9 @@ }, { "title": "skip staging area during commit.", "tip": "git commit -am " +}, { + "title": "Interactive staging.", + "tip": "git add -i" }, { "title": "List ignored files.", "tip": "git check-ignore *" From 6f732ee68e4e4e2e5943e7facfdc00ce09ba1e69 Mon Sep 17 00:00:00 2001 From: Vasyl Zuzyak Date: Thu, 23 Jun 2016 00:20:34 +0300 Subject: [PATCH 148/251] fix(commit): use proper switch to exclude staged stuff --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 887d0a1..6c24bd6 100644 --- a/README.md +++ b/README.md @@ -685,7 +685,7 @@ git rebase -i --autosquash ## skip staging area during commit. ```sh -git commit -am +git commit --only ``` ## List ignored files. diff --git a/tips.json b/tips.json index 4cb4cce..64b1e1e 100644 --- a/tips.json +++ b/tips.json @@ -281,7 +281,7 @@ "tip": "git rebase -i --autosquash" }, { "title": "skip staging area during commit.", - "tip": "git commit -am " + "tip": "git commit --only " }, { "title": "List ignored files.", "tip": "git check-ignore *" From 440a78c3572ea34ca94645a7a3d3985f31ebfa54 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Thu, 23 Jun 2016 22:43:26 +0530 Subject: [PATCH 149/251] Add tip to unstage staged file Update tips --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index e2928a8..de14a4f 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) * [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) * [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) +* [Unstaging Staged file](#unstaging-staged-file) @@ -846,5 +847,10 @@ git log --all --grep='' git log master.. --oneline | tail -1 ``` +## Unstaging Staged file +```sh +git reset HEAD +``` + diff --git a/tips.json b/tips.json index 37b72c7..37ff226 100644 --- a/tips.json +++ b/tips.json @@ -370,4 +370,7 @@ }, { "title": "Get first commit in a branch (from master)", "tip": "git log master.. --oneline | tail -1" +}, { + "title":"Unstaging Staged file", + "tip": "git reset HEAD " }] From 623e818a9481b0832c2f5df2b1b393c116e44d6a Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sat, 25 Jun 2016 11:16:58 +0530 Subject: [PATCH 150/251] Add tip to force push --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index de14a4f..8c35adc 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) * [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) * [Unstaging Staged file](#unstaging-staged-file) +* [Force push to Remote Repository](#force-push-to-remote-repository) @@ -852,5 +853,10 @@ git log master.. --oneline | tail -1 git reset HEAD ``` +## Force push to Remote Repository +```sh +git push -f +``` + diff --git a/tips.json b/tips.json index 37ff226..d6dcefa 100644 --- a/tips.json +++ b/tips.json @@ -373,4 +373,7 @@ }, { "title":"Unstaging Staged file", "tip": "git reset HEAD " +}, { + "title": "Force push to Remote Repository", + "tip": "git push -f " }] From 3839cd9dbe7e34765892120ec6c164b5c1d74695 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sat, 25 Jun 2016 11:32:14 +0530 Subject: [PATCH 151/251] tip to add remote name Update tips --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 8c35adc..aab4989 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) * [Unstaging Staged file](#unstaging-staged-file) * [Force push to Remote Repository](#force-push-to-remote-repository) +* [Adding Remote name](#adding-remote-name) @@ -858,5 +859,10 @@ git reset HEAD git push -f ``` +## Adding Remote name +```sh +git remote add origin +``` + diff --git a/tips.json b/tips.json index d6dcefa..9477ad5 100644 --- a/tips.json +++ b/tips.json @@ -376,4 +376,7 @@ }, { "title": "Force push to Remote Repository", "tip": "git push -f " +}, { + "title": "Adding Remote name", + "tip": "git remote add origin " }] From 2569c74f0346b7215264a3dff674e611fc90a015 Mon Sep 17 00:00:00 2001 From: Vitaly Tatarintsev Date: Tue, 28 Jun 2016 11:27:19 +0200 Subject: [PATCH 152/251] Change an interactive rebase description Interactive rebase can be used not only for merging files together. Files can be also be changed or updated without squashing them. --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aab4989..1989cba 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history) * [Extract file from another branch.](#extract-file-from-another-branch) * [List only the root and merge commits.](#list-only-the-root-and-merge-commits) -* [Merge previous two commits into one.](#merge-previous-two-commits-into-one) +* [Change previous two commits with an interactive rebase.](#change-previous-two-commits-with-an-interactive-rebase) * [List all branch is WIP](#list-all-branch-is-wip) * [Find guilty with binary search](#find-guilty-with-binary-search) * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) @@ -762,7 +762,7 @@ git show : git log --first-parent ``` -## Merge previous two commits into one. +## Change previous two commits with an interactive rebase. ```sh git rebase --interactive HEAD~2 ``` diff --git a/tips.json b/tips.json index 9477ad5..657b400 100644 --- a/tips.json +++ b/tips.json @@ -325,7 +325,7 @@ "title": "List only the root and merge commits.", "tip": "git log --first-parent" }, { - "title": "Merge previous two commits into one.", + "title": "Change previous two commits with an interactive rebase.", "tip": "git rebase --interactive HEAD~2" }, { "title": "List all branch is WIP", From 69185207b6e9a1e7c82b9cda4480e7ca9167eed9 Mon Sep 17 00:00:00 2001 From: Jonathan Stassen Date: Wed, 29 Jun 2016 10:14:46 -0500 Subject: [PATCH 153/251] Clarify naming a remote --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1989cba..0ddf0f2 100644 --- a/README.md +++ b/README.md @@ -861,7 +861,7 @@ git push -f ## Adding Remote name ```sh -git remote add origin +git remote add ``` diff --git a/tips.json b/tips.json index 657b400..dfc4bde 100644 --- a/tips.json +++ b/tips.json @@ -378,5 +378,5 @@ "tip": "git push -f " }, { "title": "Adding Remote name", - "tip": "git remote add origin " + "tip": "git remote add " }] From be87cde44dbd0a1945b6b83662ae25d0041be68c Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Wed, 29 Jun 2016 22:10:25 +0530 Subject: [PATCH 154/251] Add alternatives to get commit hash of initial revision --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1989cba..cc6d96d 100644 --- a/README.md +++ b/README.md @@ -545,6 +545,12 @@ git remote prune origin git rev-list --reverse HEAD | head -1 ``` + +__Alternatives:__ +```sh +git rev-list --max-parents=0 HEAD +``` + ## Visualize the version tree. ```sh git log --pretty=oneline --graph --decorate --all diff --git a/tips.json b/tips.json index 657b400..3aee552 100644 --- a/tips.json +++ b/tips.json @@ -197,7 +197,8 @@ "alternatives": ["git remote prune origin"] }, { "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1" + "tip": " git rev-list --reverse HEAD | head -1", + "alternatives": ["git rev-list --max-parents=0 HEAD"] }, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", From 49df61f4b91f5888ad151ff7137752b651528e32 Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Thu, 30 Jun 2016 23:30:27 +0530 Subject: [PATCH 155/251] Add more alternatives to get initial commit hash --- README.md | 10 ++++++++++ tips.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc6d96d..1f34272 100644 --- a/README.md +++ b/README.md @@ -551,6 +551,16 @@ __Alternatives:__ git rev-list --max-parents=0 HEAD ``` + +```sh +git log --pretty=oneline | tail -1 | cut -c 1-40 +``` + + +```sh +git log --pretty=oneline --reverse | head -1 | cut -c 1-40 +``` + ## Visualize the version tree. ```sh git log --pretty=oneline --graph --decorate --all diff --git a/tips.json b/tips.json index 3aee552..58aa75b 100644 --- a/tips.json +++ b/tips.json @@ -198,7 +198,7 @@ }, { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1", - "alternatives": ["git rev-list --max-parents=0 HEAD"] + "alternatives": ["git rev-list --max-parents=0 HEAD", "git log --pretty=oneline | tail -1 | cut -c 1-40", "git log --pretty=oneline --reverse | head -1 | cut -c 1-40"] }, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", From 7a53485d35ac32bec36c2b06c6e213a6db6bd3ce Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sun, 3 Jul 2016 19:21:33 +0530 Subject: [PATCH 156/251] Add git blame --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3a01e4..98ca3f2 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Unstaging Staged file](#unstaging-staged-file) * [Force push to Remote Repository](#force-push-to-remote-repository) * [Adding Remote name](#adding-remote-name) +* [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) @@ -880,5 +881,10 @@ git push -f git remote add ``` +## Show the author, time and last revision made to each line of a given file +```sh +git blame +``` + diff --git a/tips.json b/tips.json index 09c3595..3c1bcab 100644 --- a/tips.json +++ b/tips.json @@ -372,7 +372,7 @@ "title": "Get first commit in a branch (from master)", "tip": "git log master.. --oneline | tail -1" }, { - "title":"Unstaging Staged file", + "title": "Unstaging Staged file", "tip": "git reset HEAD " }, { "title": "Force push to Remote Repository", @@ -380,4 +380,7 @@ }, { "title": "Adding Remote name", "tip": "git remote add " +}, { + "title": "Show the author, time and last revision made to each line of a given file", + "tip": "git blame " }] From 028da4a0c3527ecc463ec8bfc69757cc90c4a9f6 Mon Sep 17 00:00:00 2001 From: Aditya Harsh Date: Thu, 7 Jul 2016 19:12:54 +0530 Subject: [PATCH 157/251] Add tip to use common diff tools --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 98ca3f2..8e15921 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch) * [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch) * [Show inline word diff.](#show-inline-word-diff) +* [Show changes using common diff tools.](#show-changes-using-common-diff-tools) * [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file) * [Undo assume-unchanged.](#undo-assume-unchanged) * [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore) @@ -634,6 +635,11 @@ git describe --tags --abbrev=0 git diff --word-diff ``` +## Show changes using common diff tools. +```sh +git difftool -t +``` + ## Don’t consider changes for tracked file. ```sh git update-index --assume-unchanged diff --git a/tips.json b/tips.json index 3c1bcab..d730120 100644 --- a/tips.json +++ b/tips.json @@ -238,6 +238,9 @@ }, { "title": "Show inline word diff.", "tip": "git diff --word-diff" +}, { + "title": "Show changes using common diff tools.", + "tip": "git difftool -t " }, { "title": "Don’t consider changes for tracked file.", "tip": "git update-index --assume-unchanged " From d764ab75165c3e4ac3d703d70093df7f9d9fec7a Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sat, 16 Jul 2016 13:33:32 +0530 Subject: [PATCH 158/251] Add git shortlog git shortlog summaries git log output. Each commit is grouped by authors and title. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 8e15921..7f80a6d 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Force push to Remote Repository](#force-push-to-remote-repository) * [Adding Remote name](#adding-remote-name) * [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) +* [Group commits by authors and title](#group-commits-by-authors-and-title) @@ -892,5 +893,10 @@ git remote add git blame ``` +## Group commits by authors and title +```sh +git shortlog +``` + diff --git a/tips.json b/tips.json index d730120..ea1779b 100644 --- a/tips.json +++ b/tips.json @@ -386,4 +386,7 @@ }, { "title": "Show the author, time and last revision made to each line of a given file", "tip": "git blame " +}, { + "title": "Group commits by authors and title", + "tip": "git shortlog" }] From 89e9fa678c89989de364f76764f89459bcd1d7ca Mon Sep 17 00:00:00 2001 From: xueweihan <595666367@qq.com> Date: Sat, 23 Jul 2016 10:35:37 +0800 Subject: [PATCH 159/251] Import Chinese version --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f80a6d..b81459f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) + P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. @@ -353,7 +355,7 @@ git branch --contains ## Git Aliases ```sh -git config --global alias. +git config --global alias. git config --global alias.st status ``` @@ -517,7 +519,7 @@ __Alternatives:__ git branch -m [] ``` -## rebases 'feature' to 'master' and merges it in to master +## rebases 'feature' to 'master' and merges it in to master ```sh git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} ``` @@ -798,12 +800,12 @@ git checkout master && git branch --no-merged ## Find guilty with binary search ```sh -git bisect start # Search start -git bisect bad # Set point to bad commit -git bisect good v2.6.13-rc2 # Set point to good commit|tag -git bisect bad # Say current state is bad -git bisect good # Say current state is good -git bisect reset # Finish search +git bisect start # Search start +git bisect bad # Set point to bad commit +git bisect good v2.6.13-rc2 # Set point to good commit|tag +git bisect bad # Say current state is bad +git bisect good # Say current state is good +git bisect reset # Finish search ``` From 3c17588d846e04cffcc94bf4c91d48dc426774fc Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Sun, 31 Jul 2016 18:22:27 +0530 Subject: [PATCH 160/251] Capitalized the first letter of certain words --- README.md | 34 +++++++++++++++++----------------- tips.json | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b81459f..9ab3cf1 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Update all the submodules](#update-all-the-submodules) * [Show all commits in the current branch yet to be merged to master](#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) * [Rename a branch](#rename-a-branch) -* [rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) +* [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) * [Archive the `master` branch](#archive-the-master-branch) * [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message) * [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) @@ -94,13 +94,13 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release) * [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do) * [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit) -* [squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) -* [skip staging area during commit.](#skip-staging-area-during-commit) +* [Squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) +* [Skip staging area during commit.](#skip-staging-area-during-commit) * [Interactive staging.](#interactive-staging) * [List ignored files.](#list-ignored-files) * [Status of ignored files.](#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) -* [reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) +* [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) * [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) * [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) * [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database) @@ -119,7 +119,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Create and switch new branch](#create-and-switch-new-branch) * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) * [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) -* [specific color settings](#specific-color-settings) +* [Specific color settings](#specific-color-settings) * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) * [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) * [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) @@ -355,7 +355,7 @@ git branch --contains ## Git Aliases ```sh -git config --global alias. +git config --global alias. git config --global alias.st status ``` @@ -519,7 +519,7 @@ __Alternatives:__ git branch -m [] ``` -## rebases 'feature' to 'master' and merges it in to master +## Rebases 'feature' to 'master' and merges it in to master ```sh git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} ``` @@ -708,12 +708,12 @@ git clean -fd --dry-run git commit --fixup ``` -## squash fixup commits normal commits. +## Squash fixup commits normal commits. ```sh git rebase -i --autosquash ``` -## skip staging area during commit. +## Skip staging area during commit. ```sh git commit --only ``` @@ -738,7 +738,7 @@ git status --ignored git log Branch1 ^Branch2 ``` -## reuse recorded resolution, record and reuse previous conflicts resolutions. +## Reuse recorded resolution, record and reuse previous conflicts resolutions. ```sh git config --global rerere.enabled 1 ``` @@ -800,12 +800,12 @@ git checkout master && git branch --no-merged ## Find guilty with binary search ```sh -git bisect start # Search start -git bisect bad # Set point to bad commit -git bisect good v2.6.13-rc2 # Set point to good commit|tag -git bisect bad # Say current state is bad -git bisect good # Say current state is good -git bisect reset # Finish search +git bisect start # Search start +git bisect bad # Set point to bad commit +git bisect good v2.6.13-rc2 # Set point to good commit|tag +git bisect bad # Say current state is bad +git bisect good # Say current state is good +git bisect reset # Finish search ``` @@ -845,7 +845,7 @@ git config core.fileMode false git config --global color.ui false ``` -## specific color settings +## Specific color settings ```sh git config --global ``` diff --git a/tips.json b/tips.json index ea1779b..08550e3 100644 --- a/tips.json +++ b/tips.json @@ -183,7 +183,7 @@ "tip": "git branch -m ", "alternatives": ["git branch -m [] "] }, { - "title": "rebases 'feature' to 'master' and merges it in to master ", + "title": "Rebases 'feature' to 'master' and merges it in to master ", "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" }, { "title": "Archive the `master` branch", @@ -281,10 +281,10 @@ "title": "Marks your commit as a fix of a previous commit.", "tip": "git commit --fixup " }, { - "title": "squash fixup commits normal commits.", + "title": "Squash fixup commits normal commits.", "tip": "git rebase -i --autosquash" }, { - "title": "skip staging area during commit.", + "title": "Skip staging area during commit.", "tip": "git commit --only " }, { "title": "Interactive staging.", @@ -299,7 +299,7 @@ "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" }, { - "title": "reuse recorded resolution, record and reuse previous conflicts resolutions.", + "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", "tip": "git config --global rerere.enabled 1" }, { "title": "Open all conflicted files in an editor.", @@ -357,7 +357,7 @@ "title": "Turn off git colored terminal output", "tip": "git config --global color.ui false" },{ - "title": "specific color settings", + "title": "Specific color settings", "tip": "git config --global " },{ "title": "Show all local branches ordered by recent commits", From 275ff62454faa748931627b9b128f9b5c0600e10 Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Wed, 10 Aug 2016 22:02:02 +0530 Subject: [PATCH 161/251] added gtip CLI link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9ab3cf1..76a4fab 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) +[gtip](https://github.com/nirajpandkar/gtip) - A handy CLI to make optimum use of these tips. + P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. From 7c9f3c88c579d8bdba6b6c9363c75477b2b268cb Mon Sep 17 00:00:00 2001 From: weirdpattern Date: Wed, 10 Aug 2016 13:08:56 -0500 Subject: [PATCH 162/251] git push --force-with-lease tip --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 9ab3cf1..2ca8f50 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Adding Remote name](#adding-remote-name) * [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) * [Group commits by authors and title](#group-commits-by-authors-and-title) +* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) @@ -900,5 +901,10 @@ git blame git shortlog ``` +## Forced push but still ensure you don't overwrite other's work +```sh +git push --force-with-lease +``` + diff --git a/tips.json b/tips.json index 08550e3..75dd558 100644 --- a/tips.json +++ b/tips.json @@ -389,4 +389,7 @@ }, { "title": "Group commits by authors and title", "tip": "git shortlog" +}, { + "title": "Forced push but still ensure you don't overwrite other's work", + "tip": "git push --force-with-lease " }] From 19e49a97e1f2fe28320cf6d79c0f40d9f7292088 Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Thu, 11 Aug 2016 11:25:16 +0530 Subject: [PATCH 163/251] changed the name of the module --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76a4fab..69ae8e2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) -[gtip](https://github.com/nirajpandkar/gtip) - A handy CLI to make optimum use of these tips. +[git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. From 4f94e6733eb86af05f78b9d7c30839aca21b223e Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Thu, 11 Aug 2016 11:41:59 +0530 Subject: [PATCH 164/251] added Tools subcategory --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 69ae8e2..1e58e8e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ [English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) -[git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. +### Tools + +* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. From debac552398de728b5689c841a623e9d640bb20e Mon Sep 17 00:00:00 2001 From: nirajpandkar Date: Thu, 11 Aug 2016 12:05:19 +0530 Subject: [PATCH 165/251] format changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e58e8e..6f4dace 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) -### Tools +### __Tools:__ * [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. From bfb1379951634c73183368f28eec5670d1ae3dc7 Mon Sep 17 00:00:00 2001 From: Changlang Kuang Date: Fri, 12 Aug 2016 19:04:12 +0800 Subject: [PATCH 166/251] add: Show how many lines does an author contribute (#121) --- README.md | 14 ++++++++++++++ tips.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index c3c31a8..fcf5404 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) * [Group commits by authors and title](#group-commits-by-authors-and-title) * [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) +* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) @@ -910,5 +911,18 @@ git shortlog git push --force-with-lease ``` +## Show how many lines does an author contribute +```sh +git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += ; subs += ; loc += - } END { printf "added lines: %s removed lines: %s total lines: %s +", add, subs, loc }' - +``` + + +__Alternatives:__ +```sh +git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += ; subs += ; loc += - } END { printf "added lines: %s, removed lines: %s, total lines: %s +", add, subs, loc }' - # on Mac OSX +``` + diff --git a/tips.json b/tips.json index 75dd558..85c762d 100644 --- a/tips.json +++ b/tips.json @@ -392,4 +392,8 @@ }, { "title": "Forced push but still ensure you don't overwrite other's work", "tip": "git push --force-with-lease " +},{ + "title": "Show how many lines does an author contribute", + "tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -", + "alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"] }] From d155ea094e281b1a7755f89896d2071f4aacd77d Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 13 Aug 2016 12:30:43 +0300 Subject: [PATCH 167/251] Add alternatives "Git reset first commit" (#111) --- README.md | 6 ++++++ tips.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fcf5404..e456f6f 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,12 @@ git ls-tree --name-only -r git update-ref -d HEAD ``` + +__Alternatives:__ +```sh +git reset --hard HEAD +``` + ## List all the conflicted files ```sh git diff --name-only --diff-filter=U diff --git a/tips.json b/tips.json index 85c762d..183a8d6 100644 --- a/tips.json +++ b/tips.json @@ -12,7 +12,8 @@ "tip": "git ls-tree --name-only -r " }, { "title": "Git reset first commit", - "tip": "git update-ref -d HEAD" + "tip": "git update-ref -d HEAD", + "alternatives": ["git reset --hard HEAD"] }, { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" From 81040e9500815384677c8068c7e1283576b59c1e Mon Sep 17 00:00:00 2001 From: S N Munendra Date: Sun, 14 Aug 2016 20:36:13 +0530 Subject: [PATCH 168/251] count commits in a branch (#122) --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index e456f6f..9eb4aed 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Group commits by authors and title](#group-commits-by-authors-and-title) * [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) * [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) +* [Number of commits in a branch](#number-of-commits-in-a-branch) @@ -930,5 +931,10 @@ git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += ", add, subs, loc }' - # on Mac OSX ``` +## Number of commits in a branch +```sh +git rev-list --count +``` + diff --git a/tips.json b/tips.json index 183a8d6..ff32f8c 100644 --- a/tips.json +++ b/tips.json @@ -397,4 +397,7 @@ "title": "Show how many lines does an author contribute", "tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -", "alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"] +},{ + "title": "Number of commits in a branch", + "tip": "git rev-list --count " }] From 9f75591eef3fca1f1fee0c9c94324aadad738194 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 13 Aug 2016 18:11:04 +0000 Subject: [PATCH 169/251] fixes #118 --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9eb4aed..13a8c4f 100644 --- a/README.md +++ b/README.md @@ -683,7 +683,7 @@ git checkout -- ## Always rebase instead of merge on pull. ```sh -git config --global branch.autosetuprebase always +git config --global pull.rebase true ``` ## List all the alias and configs. diff --git a/tips.json b/tips.json index ff32f8c..c01fedf 100644 --- a/tips.json +++ b/tips.json @@ -259,7 +259,7 @@ "tip": "git checkout -- " }, { "title": "Always rebase instead of merge on pull.", - "tip": "git config --global branch.autosetuprebase always" + "tip": "git config --global pull.rebase true" }, { "title": "List all the alias and configs.", "tip": "git config --list" From 3357955baa48d9c78304e8fe5858f4ebf158a913 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 15 Aug 2016 23:43:07 +0530 Subject: [PATCH 170/251] Fixed #117 --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13a8c4f..fd4eb42 100644 --- a/README.md +++ b/README.md @@ -534,7 +534,7 @@ git branch -m [] ## Rebases 'feature' to 'master' and merges it in to master ```sh -git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} +git rebase master feature && git checkout master && git merge - ``` ## Archive the `master` branch diff --git a/tips.json b/tips.json index c01fedf..0d63138 100644 --- a/tips.json +++ b/tips.json @@ -185,7 +185,7 @@ "alternatives": ["git branch -m [] "] }, { "title": "Rebases 'feature' to 'master' and merges it in to master ", - "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" + "tip": "git rebase master feature && git checkout master && git merge -" }, { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" From 08096c7c71429ac044a90bbd43f67aef13a91102 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 14 Aug 2016 18:14:08 +0000 Subject: [PATCH 171/251] fixes #58 --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fd4eb42..95bdcac 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Group commits by authors and title](#group-commits-by-authors-and-title) * [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) * [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) +* [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge) * [Number of commits in a branch](#number-of-commits-in-a-branch) @@ -931,6 +932,11 @@ git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += ", add, subs, loc }' - # on Mac OSX ``` +## Revert: Reverting an entire merge +```sh +git revert -m 1 +``` + ## Number of commits in a branch ```sh git rev-list --count diff --git a/tips.json b/tips.json index 0d63138..0c35cd8 100644 --- a/tips.json +++ b/tips.json @@ -397,6 +397,9 @@ "title": "Show how many lines does an author contribute", "tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -", "alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"] +},{ + "title": "Revert: Reverting an entire merge", + "tip": "git revert -m 1 " },{ "title": "Number of commits in a branch", "tip": "git rev-list --count " From 9d7a837add968948a0d86a5c2e08d47871ac9871 Mon Sep 17 00:00:00 2001 From: Gianluca Casati Date: Fri, 26 Aug 2016 13:41:30 +0200 Subject: [PATCH 172/251] added alias: git undo (#123) Credits to [Enrico Campidoglio](http://megakemp.com/about/), see [original article](http://megakemp.com/2016/08/25/git-undo/). --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 95bdcac..fd0f084 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) * [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge) * [Number of commits in a branch](#number-of-commits-in-a-branch) +* [Alias: git undo](#alias-git-undo) @@ -942,5 +943,10 @@ git revert -m 1 git rev-list --count ``` +## Alias: git undo +```sh +git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' +``` + diff --git a/tips.json b/tips.json index 0c35cd8..4aff636 100644 --- a/tips.json +++ b/tips.json @@ -403,4 +403,7 @@ },{ "title": "Number of commits in a branch", "tip": "git rev-list --count " +},{ + "title": "Alias: git undo", + "tip": "git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'" }] From dca76041d8e3c7181b26c2bdbff31c837852a82d Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 29 Aug 2016 10:54:26 +0530 Subject: [PATCH 173/251] wrong alternatives were removed --- README.md | 6 ------ tips.json | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index fd0f084..adab0cf 100644 --- a/README.md +++ b/README.md @@ -171,12 +171,6 @@ git ls-tree --name-only -r git update-ref -d HEAD ``` - -__Alternatives:__ -```sh -git reset --hard HEAD -``` - ## List all the conflicted files ```sh git diff --name-only --diff-filter=U diff --git a/tips.json b/tips.json index 4aff636..2d07351 100644 --- a/tips.json +++ b/tips.json @@ -12,8 +12,7 @@ "tip": "git ls-tree --name-only -r " }, { "title": "Git reset first commit", - "tip": "git update-ref -d HEAD", - "alternatives": ["git reset --hard HEAD"] + "tip": "git update-ref -d HEAD" }, { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" From 9007100789a3650457de12a9e15b671bd3f538c6 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 24 Sep 2016 23:10:03 +0530 Subject: [PATCH 174/251] git-notes --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index adab0cf..0cb9173 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge) * [Number of commits in a branch](#number-of-commits-in-a-branch) * [Alias: git undo](#alias-git-undo) +* [Add object notes](#add-object-notes) @@ -942,5 +943,10 @@ git rev-list --count git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' ``` +## Add object notes +```sh +git notes add -m 'Note on the previous commit....' +``` + diff --git a/tips.json b/tips.json index 2d07351..2745894 100644 --- a/tips.json +++ b/tips.json @@ -405,4 +405,7 @@ },{ "title": "Alias: git undo", "tip": "git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'" +}, { + "title": "Add object notes", + "tip": "git notes add -m 'Note on the previous commit....'" }] From 814bafcaa2f044217bdc91ad34f2cbc90cab98d3 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 24 Sep 2016 23:11:34 +0530 Subject: [PATCH 175/251] show all the git-notes --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 0cb9173..ca7e964 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Number of commits in a branch](#number-of-commits-in-a-branch) * [Alias: git undo](#alias-git-undo) * [Add object notes](#add-object-notes) +* [Show all the git-notes](#show-all-the-git-notes) @@ -948,5 +949,10 @@ git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev git notes add -m 'Note on the previous commit....' ``` +## Show all the git-notes +```sh +git log --show-notes='*' +``` + diff --git a/tips.json b/tips.json index 2745894..54bc4ef 100644 --- a/tips.json +++ b/tips.json @@ -408,4 +408,7 @@ }, { "title": "Add object notes", "tip": "git notes add -m 'Note on the previous commit....'" +}, { + "title": "Show all the git-notes", + "tip": "git log --show-notes='*'" }] From 59de6a8b8070c7720dfd50e6c5279429e993c21d Mon Sep 17 00:00:00 2001 From: Steve Bink Date: Wed, 28 Sep 2016 12:13:13 -0400 Subject: [PATCH 176/251] Apply commit from another repository (#124) --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index ca7e964..08fea5b 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Alias: git undo](#alias-git-undo) * [Add object notes](#add-object-notes) * [Show all the git-notes](#show-all-the-git-notes) +* [Apply commit from another repository](#apply-commit-from-another-repository) @@ -954,5 +955,10 @@ git notes add -m 'Note on the previous commit....' git log --show-notes='*' ``` +## Apply commit from another repository +```sh +git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k +``` + diff --git a/tips.json b/tips.json index 54bc4ef..89e877a 100644 --- a/tips.json +++ b/tips.json @@ -411,4 +411,7 @@ }, { "title": "Show all the git-notes", "tip": "git log --show-notes='*'" +}, { + "title": "Apply commit from another repository", + "tip": "git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k" }] From d2bf9e8c6343acdb3791072f79235f94789a6d3b Mon Sep 17 00:00:00 2001 From: Steve Binkowski Date: Wed, 28 Sep 2016 12:37:48 -0400 Subject: [PATCH 177/251] Find common ancestor of two branches --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 08fea5b..171d9a0 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Add object notes](#add-object-notes) * [Show all the git-notes](#show-all-the-git-notes) * [Apply commit from another repository](#apply-commit-from-another-repository) +* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) @@ -960,5 +961,10 @@ git log --show-notes='*' git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k ``` +## Find common ancestor of two branches +```sh +diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1 +``` + diff --git a/tips.json b/tips.json index 89e877a..781e03a 100644 --- a/tips.json +++ b/tips.json @@ -414,4 +414,7 @@ }, { "title": "Apply commit from another repository", "tip": "git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k" +}, { + "title": "Find common ancestor of two branches", + "tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1" }] From c42ade5ba4f8b40d12b6a9846311d507ff475691 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 2 Oct 2016 03:22:29 +0000 Subject: [PATCH 178/251] fetch ref --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 08fea5b..4443396 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Add object notes](#add-object-notes) * [Show all the git-notes](#show-all-the-git-notes) * [Apply commit from another repository](#apply-commit-from-another-repository) +* [Specific fetch reference](#specific-fetch-reference) @@ -960,5 +961,10 @@ git log --show-notes='*' git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k ``` +## Specific fetch reference +```sh +git fetch origin master:refs/remotes/origin/mymaster +``` + diff --git a/tips.json b/tips.json index 89e877a..dca6643 100644 --- a/tips.json +++ b/tips.json @@ -414,4 +414,7 @@ }, { "title": "Apply commit from another repository", "tip": "git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k" +},{ + "title": "Specific fetch reference", + "tip": "git fetch origin master:refs/remotes/origin/mymaster" }] From 50bb41326f845ffe8ea5ab2432351f057315bab4 Mon Sep 17 00:00:00 2001 From: Ankur Kumar Date: Wed, 5 Oct 2016 15:48:35 +0530 Subject: [PATCH 179/251] Add alternative for rebase on pulls (git < 1.7.9) (#126) --- README.md | 7 +++++++ tips.json | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4443396..ce3d857 100644 --- a/README.md +++ b/README.md @@ -686,6 +686,13 @@ git checkout -- git config --global pull.rebase true ``` + +__Alternatives:__ +```sh +#git < 1.7.9 +git config --global branch.autosetuprebase always +``` + ## List all the alias and configs. ```sh git config --list diff --git a/tips.json b/tips.json index dca6643..4bc19e9 100644 --- a/tips.json +++ b/tips.json @@ -258,7 +258,8 @@ "tip": "git checkout -- " }, { "title": "Always rebase instead of merge on pull.", - "tip": "git config --global pull.rebase true" + "tip": "git config --global pull.rebase true", + "alternatives" : ["#git < 1.7.9\ngit config --global branch.autosetuprebase always"] }, { "title": "List all the alias and configs.", "tip": "git config --list" From a7cb20ee0f6afe7aab23a2de1e96dda55d22b745 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 9 Oct 2016 18:14:08 +0000 Subject: [PATCH 180/251] List unpushed git commits. --- README.md | 17 +++++++++++++++++ tips.json | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 22f0676..8785d7b 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Apply commit from another repository](#apply-commit-from-another-repository) * [Specific fetch reference](#specific-fetch-reference) * [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) +* [List unpushed git commits](#list-unpushed-git-commits) @@ -979,5 +980,21 @@ git fetch origin master:refs/remotes/origin/mymaster diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1 ``` +## List unpushed git commits +```sh +git log --branches --not --remotes +``` + + +__Alternatives:__ +```sh +git log @{u}.. +``` + + +```sh +git cherry -v +``` + diff --git a/tips.json b/tips.json index c4cd799..0d44021 100644 --- a/tips.json +++ b/tips.json @@ -421,4 +421,8 @@ }, { "title": "Find common ancestor of two branches", "tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1" +}, { + "title": "List unpushed git commits", + "tip": "git log --branches --not --remotes", + "alternatives": ["git log @{u}..", "git cherry -v"] }] From 318484a77fef7aeed58d1d04f0acbe85a7f3a73b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 24 Oct 2016 21:40:06 +0530 Subject: [PATCH 181/251] add everything but whitespace changes --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8785d7b..7d46cdb 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Specific fetch reference](#specific-fetch-reference) * [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) * [List unpushed git commits](#list-unpushed-git-commits) +* [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) @@ -996,5 +997,10 @@ git log @{u}.. git cherry -v ``` +## Add everything, but whitespace changes +```sh +git diff --ignore-all-space | git apply --cached +``` + diff --git a/tips.json b/tips.json index 0d44021..fcd7e7c 100644 --- a/tips.json +++ b/tips.json @@ -425,4 +425,7 @@ "title": "List unpushed git commits", "tip": "git log --branches --not --remotes", "alternatives": ["git log @{u}..", "git cherry -v"] -}] +}, { + "title": "Add everything, but whitespace changes", + "tip": "git diff --ignore-all-space | git apply --cached" +}] \ No newline at end of file From 6886c2c8f639816b2688e796a94c3a7a44949b1b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 30 Oct 2016 14:41:20 +0000 Subject: [PATCH 182/251] edit git config --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 7d46cdb..4b6f118 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) * [List unpushed git commits](#list-unpushed-git-commits) * [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) +* [Edit [local/global] git config](#edit-localglobal-git-config) @@ -1002,5 +1003,10 @@ git cherry -v git diff --ignore-all-space | git apply --cached ``` +## Edit [local/global] git config +```sh +git config [--global] --edit +``` + diff --git a/tips.json b/tips.json index fcd7e7c..e508888 100644 --- a/tips.json +++ b/tips.json @@ -428,4 +428,7 @@ }, { "title": "Add everything, but whitespace changes", "tip": "git diff --ignore-all-space | git apply --cached" +}, { + "title": "Edit [local/global] git config", + "tip": "git config [--global] --edit" }] \ No newline at end of file From 9e7c67ed6c6c9afe7b3c229e7b98e7474571871b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 31 Oct 2016 21:18:46 +0530 Subject: [PATCH 183/251] blame on certain range --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 4b6f118..8281097 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List unpushed git commits](#list-unpushed-git-commits) * [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) * [Edit [local/global] git config](#edit-localglobal-git-config) +* [blame on certain range](#blame-on-certain-range) @@ -1008,5 +1009,10 @@ git diff --ignore-all-space | git apply --cached git config [--global] --edit ``` +## blame on certain range +```sh +git blame -L , +``` + diff --git a/tips.json b/tips.json index e508888..dd299d3 100644 --- a/tips.json +++ b/tips.json @@ -431,4 +431,7 @@ }, { "title": "Edit [local/global] git config", "tip": "git config [--global] --edit" +}, { + "title": "blame on certain range", + "tip": "git blame -L ," }] \ No newline at end of file From 37d2ef123c91bb981ddb861624a2238b354c3677 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 28 Nov 2016 01:35:33 +0300 Subject: [PATCH 184/251] Fixing git bash completion script URL. http://git.io/vfhol This URL leads to the needful script via redirect. When I do `$ curl http://git.io/vfhol` (on OSX, at least), it fetches redirect info: ```sh You are being redirected. ``` When I set curl option to -L (--location), everything works properly. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8281097..6456e72 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ git add -p ## Get git bash completion ```sh -curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc +curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` ## What changed since two weeks? From 16b9349d48ff564a51743878c7de65ab0b6be648 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 12 Dec 2016 20:16:32 +0530 Subject: [PATCH 185/251] show a Git logical variable. --- README.md | 8 +++++++- tips.json | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6456e72..57829c3 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) * [Edit [local/global] git config](#edit-localglobal-git-config) * [blame on certain range](#blame-on-certain-range) +* [Show a Git logical variable.](#show-a-git-logical-variable) @@ -336,7 +337,7 @@ git add -p ## Get git bash completion ```sh -curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc +curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` ## What changed since two weeks? @@ -1014,5 +1015,10 @@ git config [--global] --edit git blame -L , ``` +## Show a Git logical variable. +```sh +git var -l | +``` + diff --git a/tips.json b/tips.json index dd299d3..34deda9 100644 --- a/tips.json +++ b/tips.json @@ -434,4 +434,7 @@ }, { "title": "blame on certain range", "tip": "git blame -L ," +}, { + "title": "Show a Git logical variable.", + "tip":"git var -l | " }] \ No newline at end of file From 5d23b75504901dfe9bbb212db9eac65bbad75805 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 25 Dec 2016 21:23:02 +0530 Subject: [PATCH 186/251] format-patch --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 57829c3..c52cb06 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Edit [local/global] git config](#edit-localglobal-git-config) * [blame on certain range](#blame-on-certain-range) * [Show a Git logical variable.](#show-a-git-logical-variable) +* [Preformatted patch file.](#preformatted-patch-file) @@ -1020,5 +1021,10 @@ git blame -L , git var -l | ``` +## Preformatted patch file. +```sh +git format-patch -M upstream..topic +``` + diff --git a/tips.json b/tips.json index 34deda9..cc95b68 100644 --- a/tips.json +++ b/tips.json @@ -437,4 +437,7 @@ }, { "title": "Show a Git logical variable.", "tip":"git var -l | " +}, { + "title": "Preformatted patch file.", + "tip": "git format-patch -M upstream..topic" }] \ No newline at end of file From e88ee1e1c9be3a22c3e3fdb7f22088eff85268d2 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 8 Jan 2017 17:53:01 +0530 Subject: [PATCH 187/251] Get the repo name. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index c52cb06..ce7e45c 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [blame on certain range](#blame-on-certain-range) * [Show a Git logical variable.](#show-a-git-logical-variable) * [Preformatted patch file.](#preformatted-patch-file) +* [Get the repo name.](#get-the-repo-name) @@ -1026,5 +1027,10 @@ git var -l | git format-patch -M upstream..topic ``` +## Get the repo name. +```sh +git rev-parse --show-toplevel +``` + diff --git a/tips.json b/tips.json index cc95b68..5aae461 100644 --- a/tips.json +++ b/tips.json @@ -440,4 +440,7 @@ }, { "title": "Preformatted patch file.", "tip": "git format-patch -M upstream..topic" +}, { + "title": "Get the repo name.", + "tip": "git rev-parse --show-toplevel" }] \ No newline at end of file From e6bbc5941883dafe711d156b2a4b0672dc611a8b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 16 Jan 2017 22:04:23 +0530 Subject: [PATCH 188/251] logs between date range --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index ce7e45c..24a4ebe 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show a Git logical variable.](#show-a-git-logical-variable) * [Preformatted patch file.](#preformatted-patch-file) * [Get the repo name.](#get-the-repo-name) +* [logs between date range](#logs-between-date-range) @@ -1032,5 +1033,10 @@ git format-patch -M upstream..topic git rev-parse --show-toplevel ``` +## logs between date range +```sh +git log --since='FEB 1 2017' --until='FEB 14 2017' +``` + diff --git a/tips.json b/tips.json index 5aae461..2daf36a 100644 --- a/tips.json +++ b/tips.json @@ -443,4 +443,7 @@ }, { "title": "Get the repo name.", "tip": "git rev-parse --show-toplevel" +}, { + "title": "logs between date range", + "tip": "git log --since='FEB 1 2017' --until='FEB 14 2017'" }] \ No newline at end of file From 2b772cda5b8a968c856523307fa4fca821b5cad9 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Mon, 16 Jan 2017 22:07:20 +0530 Subject: [PATCH 189/251] Exclude author from logs --- README.md | 7 +++++++ tips.json | 3 +++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 24a4ebe..6c76c23 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Preformatted patch file.](#preformatted-patch-file) * [Get the repo name.](#get-the-repo-name) * [logs between date range](#logs-between-date-range) +* [Exclude author from logs](#exclude-author-from-logs) @@ -1038,5 +1039,11 @@ git rev-parse --show-toplevel git log --since='FEB 1 2017' --until='FEB 14 2017' ``` +## Exclude author from logs +```sh +git log --perl-regexp --author='^((?!excluded-author-regex).*) + +``` + diff --git a/tips.json b/tips.json index 2daf36a..d27af25 100644 --- a/tips.json +++ b/tips.json @@ -446,4 +446,7 @@ }, { "title": "logs between date range", "tip": "git log --since='FEB 1 2017' --until='FEB 14 2017'" +}, { + "title": "Exclude author from logs", + "tip": "git log --perl-regexp --author='^((?!excluded-author-regex).*)$'" }] \ No newline at end of file From 5822d83f518bb66e6be83dc2cd342477cec7a1c8 Mon Sep 17 00:00:00 2001 From: djoudi mohammed Date: Fri, 20 Jan 2017 14:28:35 +0100 Subject: [PATCH 190/251] Doc update - Link added to Docker version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c76c23..3f2e3f0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### __Tools:__ -* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. +* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. ([Here in Docker container](https://github.com/djoudi5/docker-git-tip)) P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. From 3261e1fb66764fafa81196f1c5053a08ac550bf3 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 25 Jan 2017 04:06:52 +0000 Subject: [PATCH 191/251] pull-request command --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 3f2e3f0..c762252 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Get the repo name.](#get-the-repo-name) * [logs between date range](#logs-between-date-range) * [Exclude author from logs](#exclude-author-from-logs) +* [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) @@ -1045,5 +1046,10 @@ git log --perl-regexp --author='^((?!excluded-author-regex).*) ``` +## Generates a summary of pending changes +```sh +git request-pull v1.0 https://git.ko.xz/project master:for-linus +``` + diff --git a/tips.json b/tips.json index d27af25..a9ee2df 100644 --- a/tips.json +++ b/tips.json @@ -449,4 +449,7 @@ }, { "title": "Exclude author from logs", "tip": "git log --perl-regexp --author='^((?!excluded-author-regex).*)$'" +}, { + "title": "Generates a summary of pending changes", + "tip": "git request-pull v1.0 https://git.ko.xz/project master:for-linus" }] \ No newline at end of file From 7b0e0e471c9f5e3bd0bdcae999f3d270a75a45a2 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 26 Jan 2017 17:06:30 +0530 Subject: [PATCH 192/251] ls-remote --- .vscode/settings.json | 3 +++ README.md | 6 ++++++ tips.json | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4748804 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.enable": false +} \ No newline at end of file diff --git a/README.md b/README.md index c762252..ae9540c 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [logs between date range](#logs-between-date-range) * [Exclude author from logs](#exclude-author-from-logs) * [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) +* [List references in a remote repository](#list-references-in-a-remote-repository) @@ -1051,5 +1052,10 @@ git log --perl-regexp --author='^((?!excluded-author-regex).*) git request-pull v1.0 https://git.ko.xz/project master:for-linus ``` +## List references in a remote repository +```sh +git ls-remote git://git.kernel.org/pub/scm/git/git.git +``` + diff --git a/tips.json b/tips.json index a9ee2df..10eea9f 100644 --- a/tips.json +++ b/tips.json @@ -452,4 +452,7 @@ }, { "title": "Generates a summary of pending changes", "tip": "git request-pull v1.0 https://git.ko.xz/project master:for-linus" +}, { + "title":"List references in a remote repository", + "tip": "git ls-remote git://git.kernel.org/pub/scm/git/git.git" }] \ No newline at end of file From 0bc5364128d42b42eef413faac9946636c887e98 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 29 Jan 2017 15:54:27 +0530 Subject: [PATCH 193/251] Backup untracked files. --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index ae9540c..b1f09eb 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Exclude author from logs](#exclude-author-from-logs) * [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) * [List references in a remote repository](#list-references-in-a-remote-repository) +* [Backup untracked files.](#backup-untracked-files) @@ -1057,5 +1058,10 @@ git request-pull v1.0 https://git.ko.xz/project master:for-linus git ls-remote git://git.kernel.org/pub/scm/git/git.git ``` +## Backup untracked files. +```sh +git ls-files --others -i --exclude-standard | xargs zip untracked.zip +``` + diff --git a/tips.json b/tips.json index 10eea9f..5e73ee3 100644 --- a/tips.json +++ b/tips.json @@ -455,4 +455,7 @@ }, { "title":"List references in a remote repository", "tip": "git ls-remote git://git.kernel.org/pub/scm/git/git.git" +}, { + "title": "Backup untracked files.", + "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" }] \ No newline at end of file From ba3cda945fb3bd0a2ae407f280513f947aa37da2 Mon Sep 17 00:00:00 2001 From: Muhammad Imangazaliev Date: Mon, 13 Feb 2017 18:03:03 +0300 Subject: [PATCH 194/251] Add link to Russian translation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b1f09eb..82ea037 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) ### __Tools:__ From 1274a98aba97896e4024dcadbc7ecf0c76370464 Mon Sep 17 00:00:00 2001 From: shfshanyue Date: Thu, 16 Feb 2017 10:29:36 +0800 Subject: [PATCH 195/251] Add alternative for git checkout - --- README.md | 6 ++++++ tips.json | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 82ea037..9220065 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,12 @@ git branch --merged master git checkout - ``` + +__Alternatives:__ +```sh +git checkout @{-1} +``` + ## Remove branches that have already been merged with master ```sh git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d diff --git a/tips.json b/tips.json index 5e73ee3..568afc3 100644 --- a/tips.json +++ b/tips.json @@ -34,7 +34,8 @@ "tip": "git branch --merged master" }, { "title": "Quickly switch to the previous branch", - "tip": "git checkout -" + "tip": "git checkout -", + "alternatives": ["git checkout @{-1}"] }, { "title": "Remove branches that have already been merged with master", "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", @@ -458,4 +459,4 @@ }, { "title": "Backup untracked files.", "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" -}] \ No newline at end of file +}] From 6fd5b4b52d6221113f884d931a25b2f98ab3dbca Mon Sep 17 00:00:00 2001 From: shfshanyue Date: Tue, 21 Feb 2017 13:57:24 +0800 Subject: [PATCH 196/251] Add tip: git log -n --- README.md | 12 ++++++++++++ tips.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 9220065..5f993d0 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List ignored files.](#list-ignored-files) * [Status of ignored files.](#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) +* [List n last commits](#list-n-last-commits) * [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) * [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) * [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) @@ -777,6 +778,17 @@ git status --ignored git log Branch1 ^Branch2 ``` +## List n last commits +```sh +git log - +``` + + +__Alternatives:__ +```sh +git log -n +``` + ## Reuse recorded resolution, record and reuse previous conflicts resolutions. ```sh git config --global rerere.enabled 1 diff --git a/tips.json b/tips.json index 568afc3..b2c216c 100644 --- a/tips.json +++ b/tips.json @@ -300,6 +300,10 @@ }, { "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" +}, { + "title": "List n last commits", + "tip": "git log -", + "alternatives": ["git log -n "] }, { "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", "tip": "git config --global rerere.enabled 1" From e574325d660cdf7c1e93332226abb78084bdbe86 Mon Sep 17 00:00:00 2001 From: shfshanyue Date: Tue, 21 Feb 2017 16:35:57 +0800 Subject: [PATCH 197/251] Add tip: git stash save --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 5f993d0..d965a0e 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Git Aliases](#git-aliases) * [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) * [Saving current state including untracked files](#saving-current-state-including-untracked-files) +* [Saving current state with message](#saving-current-state-with-message) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) * [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) @@ -414,6 +415,11 @@ __Alternatives:__ git stash save --include-untracked ``` +## Saving current state with message +```sh +git stash save +``` + ## Show list of all saved stashes ```sh git stash list diff --git a/tips.json b/tips.json index b2c216c..9fe00f9 100644 --- a/tips.json +++ b/tips.json @@ -124,6 +124,9 @@ "title": "Saving current state including untracked files", "tip": "git stash save -u", "alternatives": ["git stash save --include-untracked"] +}, { + "title": "Saving current state with message", + "tip": "git stash save " }, { "title": "Show list of all saved stashes", "tip": "git stash list" From 7d8adcb4075677045f664d814840b0aaae81bb47 Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Wed, 22 Feb 2017 17:26:38 +0000 Subject: [PATCH 198/251] Add list all git aliases --- README.md | 12 ++++++++++++ tips.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index d965a0e..47dc259 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) * [List references in a remote repository](#list-references-in-a-remote-repository) * [Backup untracked files.](#backup-untracked-files) +* [List all git aliases](#list-all-git-aliases) @@ -1087,5 +1088,16 @@ git ls-remote git://git.kernel.org/pub/scm/git/git.git git ls-files --others -i --exclude-standard | xargs zip untracked.zip ``` +## List all git aliases +```sh +git config -l | grep alias | sed 's/^alias\.//g' +``` + + +__Alternatives:__ +```sh +git config -l | grep alias | cut -d '.' -f 2 +``` + diff --git a/tips.json b/tips.json index 9fe00f9..d0ac2fe 100644 --- a/tips.json +++ b/tips.json @@ -466,4 +466,8 @@ }, { "title": "Backup untracked files.", "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" +}, { + "title": "List all git aliases", + "tip": "git config -l | grep alias | sed 's/^alias\\.//g'", + "alternatives": ["git config -l | grep alias | cut -d '.' -f 2"] }] From 9dc216197a0b9e1110635d606a3a7ea4f0767b1f Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Thu, 23 Feb 2017 10:15:03 +0000 Subject: [PATCH 199/251] Add git status short --- README.md | 6 ++++++ tips.json | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 47dc259..b3be0f2 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List references in a remote repository](#list-references-in-a-remote-repository) * [Backup untracked files.](#backup-untracked-files) * [List all git aliases](#list-all-git-aliases) +* [Show git status short](#show-git-status-short) @@ -1099,5 +1100,10 @@ __Alternatives:__ git config -l | grep alias | cut -d '.' -f 2 ``` +## Show git status short +```sh +git status --short --branch +``` + diff --git a/tips.json b/tips.json index d0ac2fe..a48a076 100644 --- a/tips.json +++ b/tips.json @@ -470,4 +470,8 @@ "title": "List all git aliases", "tip": "git config -l | grep alias | sed 's/^alias\\.//g'", "alternatives": ["git config -l | grep alias | cut -d '.' -f 2"] -}] +},{ + "title": "Show git status short", + "tip": "git status --short --branch" +} +] From f9ec0251aa89a88dcba1045f710fce8c679a4b5c Mon Sep 17 00:00:00 2001 From: Sina Siadat Date: Fri, 24 Feb 2017 14:19:12 +0330 Subject: [PATCH 200/251] Fetch origin, not --all --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3be0f2..3afcc9f 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ git help -g ## Overwrite pull ```sh -git fetch --all && git reset --hard origin/master +git fetch origin && git reset --hard origin/master ``` ## List of all files till a commit diff --git a/tips.json b/tips.json index a48a076..0f7c9e4 100644 --- a/tips.json +++ b/tips.json @@ -6,7 +6,7 @@ "tip": "git help -g" }, { "title": "Overwrite pull", - "tip": "git fetch --all && git reset --hard origin/master" + "tip": "git fetch origin && git reset --hard origin/master" }, { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " From c8abe4cc13d1ed340525d1dab18a65b29f0d343f Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:29:18 +0000 Subject: [PATCH 201/251] Add stash of unstaged changes to tracked files --- README.md | 17 +++++++++++++++++ tips.json | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index 3afcc9f..b7e549b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash) * [Git Aliases](#git-aliases) * [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) +* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files) * [Saving current state including untracked files](#saving-current-state-including-untracked-files) * [Saving current state with message](#saving-current-state-with-message) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) @@ -406,6 +407,22 @@ __Alternatives:__ git stash save ``` +## Saving current state of unstaged changes to tracked files +```sh +git stash -k +``` + + +__Alternatives:__ +```sh +git stash --keep-index +``` + + +```sh +git stash save --keep-index +``` + ## Saving current state including untracked files ```sh git stash save -u diff --git a/tips.json b/tips.json index 0f7c9e4..ab99a12 100644 --- a/tips.json +++ b/tips.json @@ -120,6 +120,10 @@ "title": "Saving current state of tracked files without commiting", "tip": "git stash", "alternatives": ["git stash save"] +}, { + "title": "Saving current state of unstaged changes to tracked files", + "tip": "git stash -k", + "alternatives": ["git stash --keep-index", "git stash save --keep-index"] }, { "title": "Saving current state including untracked files", "tip": "git stash save -u", From 3fe8a233c09e7c2ed1878c00f9acd34bf636aecb Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:38:44 +0000 Subject: [PATCH 202/251] Add stash all --- README.md | 17 +++++++++++++++++ tips.json | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index b7e549b..cad7841 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files) * [Saving current state including untracked files](#saving-current-state-including-untracked-files) * [Saving current state with message](#saving-current-state-with-message) +* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) * [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) @@ -439,6 +440,22 @@ git stash save --include-untracked git stash save ``` +## Saving current state of all files (ignored, untracked, and tracked) +```sh +git stash -a +``` + + +__Alternatives:__ +```sh +git stash --all +``` + + +```sh +git stash save --all +``` + ## Show list of all saved stashes ```sh git stash list diff --git a/tips.json b/tips.json index ab99a12..2693d2b 100644 --- a/tips.json +++ b/tips.json @@ -131,6 +131,10 @@ }, { "title": "Saving current state with message", "tip": "git stash save " +}, { + "title": "Saving current state of all files (ignored, untracked, and tracked)", + "tip": "git stash -a", + "alternatives": ["git stash --all", "git stash save --all"] }, { "title": "Show list of all saved stashes", "tip": "git stash list" From e849a6f24a4ddaeeccc1595992fb87cddc99bc11 Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Fri, 24 Feb 2017 11:44:13 +0000 Subject: [PATCH 203/251] No need for git stash save --- README.md | 7 ++++++- tips.json | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cad7841..f0bc850 100644 --- a/README.md +++ b/README.md @@ -426,11 +426,16 @@ git stash save --keep-index ## Saving current state including untracked files ```sh -git stash save -u +git stash -u ``` __Alternatives:__ +```sh +git stash save -u +``` + + ```sh git stash save --include-untracked ``` diff --git a/tips.json b/tips.json index 2693d2b..16b56eb 100644 --- a/tips.json +++ b/tips.json @@ -126,8 +126,8 @@ "alternatives": ["git stash --keep-index", "git stash save --keep-index"] }, { "title": "Saving current state including untracked files", - "tip": "git stash save -u", - "alternatives": ["git stash save --include-untracked"] + "tip": "git stash -u", + "alternatives": ["git stash save -u", "git stash save --include-untracked"] }, { "title": "Saving current state with message", "tip": "git stash save " From af614c269eb16d8a5cb27f305ade4bf8346b08df Mon Sep 17 00:00:00 2001 From: Juan Ignacio Donoso Date: Thu, 9 Mar 2017 14:22:47 -0500 Subject: [PATCH 204/251] Add alternative to remove remote tag --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0bc850..e2eca76 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,13 @@ git tag -d ## Delete remote tag ```sh -git push origin :refs/tags/ +git push origin : +``` + + +__Alternatives:__ +```sh +git push origin :refs/tags/ ``` ## Undo local changes with the last content in head From 81f9099a1f4466e6c264bd2eb1ef0bb0a48cb389 Mon Sep 17 00:00:00 2001 From: eliranm Date: Thu, 23 Mar 2017 15:09:46 +0200 Subject: [PATCH 205/251] add change by content search tip --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f0bc850..8be62cf 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) +* [Search change by content](#search-change-by-content) * [Overwrite pull](#overwrite-pull) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) @@ -179,6 +180,11 @@ git help everyday git help -g ``` +## Search change by content +```sh +git log -S'' +``` + ## Overwrite pull ```sh git fetch origin && git reset --hard origin/master diff --git a/tips.json b/tips.json index 16b56eb..0c5a3e2 100644 --- a/tips.json +++ b/tips.json @@ -4,6 +4,9 @@ }, { "title": "Show helpful guides that come with Git", "tip": "git help -g" +}, { + "title": "Search change by content", + "tip": "git log -S''" }, { "title": "Overwrite pull", "tip": "git fetch origin && git reset --hard origin/master" From 3c766833b4625753b254645c4d619b9b176781cd Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:07:51 +0300 Subject: [PATCH 206/251] update "overwrite pull": - rename to "sync with remote" for clarity - add 'git clean' to ensure working tree is clean --- README.md | 6 +++--- tips.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8be62cf..c518583 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Overwrite pull](#overwrite-pull) +* [Sync with remote](#sync-with-remote) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,9 +185,9 @@ git help -g git log -S'' ``` -## Overwrite pull +## Sync with remote ```sh -git fetch origin && git reset --hard origin/master +git fetch origin && git reset --hard origin/master && git clean -f -d ``` ## List of all files till a commit diff --git a/tips.json b/tips.json index 0c5a3e2..9d3b1ce 100644 --- a/tips.json +++ b/tips.json @@ -8,8 +8,8 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Overwrite pull", - "tip": "git fetch origin && git reset --hard origin/master" + "title": "Sync with remote", + "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", "tip": "git ls-tree --name-only -r " From 3d4092c3bd7c7cd3fa9ee5c0d695861b5201eb57 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:08:59 +0300 Subject: [PATCH 207/251] add .idea to .gitignore, for intellij-idea/webstorm users --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 93f1361..67d713f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.idea node_modules npm-debug.log From 48a611a626a984cf4c932c9e934178fc97a8ee90 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:13:33 +0300 Subject: [PATCH 208/251] update sync with remote title for brevity --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c518583..6348949 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Sync with remote](#sync-with-remote) +* [Sync with remote (overwrite local changes)](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,7 +185,7 @@ git help -g git log -S'' ``` -## Sync with remote +## Sync with remote (overwrite local changes) ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` diff --git a/tips.json b/tips.json index 9d3b1ce..a6a99d5 100644 --- a/tips.json +++ b/tips.json @@ -8,7 +8,7 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Sync with remote", + "title": "Sync with remote (overwrite local changes)", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", From 2ce1f0fb06051953d734835f767b360f6f8d9764 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:14:45 +0300 Subject: [PATCH 209/251] update sync with remote title for brevity --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6348949..8d2a553 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Sync with remote (overwrite local changes)](#sync-with-remote-overwrite-local-changes) +* [Sync with remote - overwrite local changes](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,7 +185,7 @@ git help -g git log -S'' ``` -## Sync with remote (overwrite local changes) +## Sync with remote - overwrite local changes ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` diff --git a/tips.json b/tips.json index a6a99d5..90526c8 100644 --- a/tips.json +++ b/tips.json @@ -8,7 +8,7 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Sync with remote (overwrite local changes)", + "title": "Sync with remote - overwrite local changes", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", From 1d4eca0e251cf9cc43c7cbd2cb11cf3928d0eed7 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:16:50 +0300 Subject: [PATCH 210/251] update sync with remote title for brevity --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8d2a553..6348949 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Sync with remote - overwrite local changes](#sync-with-remote-overwrite-local-changes) +* [Sync with remote (overwrite local changes)](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,7 +185,7 @@ git help -g git log -S'' ``` -## Sync with remote - overwrite local changes +## Sync with remote (overwrite local changes) ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` diff --git a/tips.json b/tips.json index 90526c8..a6a99d5 100644 --- a/tips.json +++ b/tips.json @@ -8,7 +8,7 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Sync with remote - overwrite local changes", + "title": "Sync with remote (overwrite local changes)", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", From b0d87788efa58a58bc3b0e1a93978a675fa66dd3 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:17:39 +0300 Subject: [PATCH 211/251] update sync with remote title for brevity --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6348949..8d2a553 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Sync with remote (overwrite local changes)](#sync-with-remote-overwrite-local-changes) +* [Sync with remote - overwrite local changes](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,7 +185,7 @@ git help -g git log -S'' ``` -## Sync with remote (overwrite local changes) +## Sync with remote - overwrite local changes ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` diff --git a/tips.json b/tips.json index a6a99d5..90526c8 100644 --- a/tips.json +++ b/tips.json @@ -8,7 +8,7 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Sync with remote (overwrite local changes)", + "title": "Sync with remote - overwrite local changes", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", From 18f472475799c9c485455cda353fc5f0312517c8 Mon Sep 17 00:00:00 2001 From: eliranm Date: Tue, 28 Mar 2017 11:29:18 +0300 Subject: [PATCH 212/251] fix broken link --- README.md | 12 +++--------- tips.json | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index afb2649..1a0b680 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) -* [Sync with remote - overwrite local changes](#sync-with-remote-overwrite-local-changes) +* [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) * [List all the conflicted files](#list-all-the-conflicted-files) @@ -185,7 +185,7 @@ git help -g git log -S'' ``` -## Sync with remote - overwrite local changes +## Sync with remote, overwrite local changes ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` @@ -291,13 +291,7 @@ git tag -d ## Delete remote tag ```sh -git push origin : -``` - - -__Alternatives:__ -```sh -git push origin :refs/tags/ +git push origin :refs/tags/ ``` ## Undo local changes with the last content in head diff --git a/tips.json b/tips.json index 90526c8..e32beae 100644 --- a/tips.json +++ b/tips.json @@ -8,7 +8,7 @@ "title": "Search change by content", "tip": "git log -S''" }, { - "title": "Sync with remote - overwrite local changes", + "title": "Sync with remote, overwrite local changes", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" }, { "title": "List of all files till a commit", From 39d1012fc9652aa9853d58d0fd1086070d82e4f7 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 1 Apr 2017 01:30:00 +0530 Subject: [PATCH 213/251] Checkout a commit prior to a day ago. --- .vscode/settings.json | 3 ++- README.md | 6 ++++++ tips.json | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4748804..9097a64 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "eslint.enable": false + "eslint.enable": false, + "vsicons.presets.angular": false } \ No newline at end of file diff --git a/README.md b/README.md index 1a0b680..ae22f2a 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Backup untracked files.](#backup-untracked-files) * [List all git aliases](#list-all-git-aliases) * [Show git status short](#show-git-status-short) +* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) @@ -1150,5 +1151,10 @@ git config -l | grep alias | cut -d '.' -f 2 git status --short --branch ``` +## Checkout a commit prior to a day ago +```sh +git checkout master@{yesterday} +``` + diff --git a/tips.json b/tips.json index e32beae..57486bb 100644 --- a/tips.json +++ b/tips.json @@ -484,5 +484,9 @@ },{ "title": "Show git status short", "tip": "git status --short --branch" -} +}, + { + "title": "Checkout a commit prior to a day ago", + "tip": "git checkout master@{yesterday}" + } ] From f65336b83df27937974e46387a68ab4f95fa2cbc Mon Sep 17 00:00:00 2001 From: mingrammer Date: Mon, 26 Jun 2017 01:07:39 +0900 Subject: [PATCH 214/251] Add a translation link for korean --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae22f2a..8ee9e09 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) ### __Tools:__ From 33dc77736c426c995dab3cc0862942f906be56b9 Mon Sep 17 00:00:00 2001 From: Chaithanya Ganta Date: Tue, 8 Aug 2017 15:41:23 +0530 Subject: [PATCH 215/251] Push a new local branch to remote and track --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ee9e09..896bc5d 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List all git aliases](#list-all-git-aliases) * [Show git status short](#show-git-status-short) * [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) +* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) @@ -1156,5 +1157,10 @@ git status --short --branch git checkout master@{yesterday} ``` +## Push a new local branch to remote repository and track +```sh +git push -u origin +``` + diff --git a/tips.json b/tips.json index 57486bb..59b6eae 100644 --- a/tips.json +++ b/tips.json @@ -488,5 +488,8 @@ { "title": "Checkout a commit prior to a day ago", "tip": "git checkout master@{yesterday}" - } + }, { + "title": "Push a new local branch to remote repository and track", + "tip": "git push -u origin " +} ] From 741782cdb0904d4f0d59ca6249852b9d7106d981 Mon Sep 17 00:00:00 2001 From: lukabot Date: Tue, 24 Oct 2017 11:14:00 +0900 Subject: [PATCH 216/251] Remove duplicated command --- README.md | 6 ------ tips.json | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 896bc5d..9161377 100644 --- a/README.md +++ b/README.md @@ -563,12 +563,6 @@ git clean -f git clean -f -d ``` - -__Alternatives:__ -```sh -git clean -df -``` - ## Update all the submodules ```sh git submodule foreach git pull diff --git a/tips.json b/tips.json index 59b6eae..92d1b38 100644 --- a/tips.json +++ b/tips.json @@ -183,8 +183,7 @@ "tip": "git clean -f" }, { "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d", - "alternatives": ["git clean -df"] + "tip": "git clean -f -d" }, { "title": "Update all the submodules", "tip": "git submodule foreach git pull", From 3b0185e443910f215b98e5b001e6d87bea536f30 Mon Sep 17 00:00:00 2001 From: eliranm Date: Mon, 30 Oct 2017 12:24:22 +0200 Subject: [PATCH 217/251] add a tip to remove sensitive data from history (after a push) --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 9161377..20349b2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) +* [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push) * [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) @@ -187,6 +188,11 @@ git help -g git log -S'' ``` +## Remove sensitive data from history, after a push +```sh +git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all +``` + ## Sync with remote, overwrite local changes ```sh git fetch origin && git reset --hard origin/master && git clean -f -d diff --git a/tips.json b/tips.json index 92d1b38..c5c7924 100644 --- a/tips.json +++ b/tips.json @@ -7,6 +7,9 @@ }, { "title": "Search change by content", "tip": "git log -S''" +}, { + "title": "Remove sensitive data from history, after a push", + "tip": "git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all" }, { "title": "Sync with remote, overwrite local changes", "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" From 4bf33b325890ea9c90e845a5abb4ddc921beb14b Mon Sep 17 00:00:00 2001 From: John Pham Date: Mon, 27 Nov 2017 12:14:07 +0700 Subject: [PATCH 218/251] Add a translation link for Vietnamese --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9161377..bd7b226 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) ### __Tools:__ From a7b9fbf3b16617f06eb3ec492defc95b1223728b Mon Sep 17 00:00:00 2001 From: Mohit Agarwal Date: Wed, 20 Dec 2017 15:13:08 +0530 Subject: [PATCH 219/251] Fix difftool example The example currently reads: git difftool -t This would cause `commit1` to be considered as the diff tool. --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b6421ec..8681c13 100644 --- a/README.md +++ b/README.md @@ -728,7 +728,7 @@ git diff --word-diff ## Show changes using common diff tools. ```sh -git difftool -t +git difftool [-t ] ``` ## Don’t consider changes for tracked file. diff --git a/tips.json b/tips.json index c5c7924..0cc3d88 100644 --- a/tips.json +++ b/tips.json @@ -257,7 +257,7 @@ "tip": "git diff --word-diff" }, { "title": "Show changes using common diff tools.", - "tip": "git difftool -t " + "tip": "git difftool [-t ] " }, { "title": "Don’t consider changes for tracked file.", "tip": "git update-index --assume-unchanged " From 26e8a7be82c4286d97d617318fabb99f30055756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Uma=C3=B1a?= Date: Thu, 8 Mar 2018 16:48:00 -0600 Subject: [PATCH 220/251] An alternative with shorter hash, author and relative date for "Visualize the version tree." tip, has been added. --- README.md | 5 +++++ tips.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8681c13..f13ee01 100644 --- a/README.md +++ b/README.md @@ -665,6 +665,11 @@ __Alternatives:__ gitk --all ``` + +```sh +git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d' +``` + ## Deploying git tracked subfolder to gh-pages ```sh git subtree push --prefix subfolder_name origin gh-pages diff --git a/tips.json b/tips.json index 0cc3d88..6de1373 100644 --- a/tips.json +++ b/tips.json @@ -219,7 +219,7 @@ }, { "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": ["gitk --all"] + "alternatives": ["gitk --all","git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'"] }, { "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", From 0286eb33145b8830170b08bbbffbd6afa3b3b65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ni=20Marvaud?= <24732919+lmarvaud@users.noreply.github.com> Date: Wed, 21 Mar 2018 20:24:10 +0100 Subject: [PATCH 221/251] Add change a branch base tips Based on : https://stackoverflow.com/questions/10853935/change-branch-base Tested on `git version 2.11.0 (Apple Git-81)` : ```bash-4.3$ git --version git version 2.11.0 (Apple Git-81) bash-4.3$ git checkout -b test-rebase-onto Switched to a new branch 'test-rebase-onto' bash-4.3$ touch "test-to-rebase" bash-4.3$ git add test-to-rebase bash-4.3$ git commit -m "Commit to rebase" [test-rebase-onto 11d1cdd] Commit to rebase 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test-to-rebase bash-4.3$ git log bash-4.3$ git rebase --onto master dev Applying: Commit to rebase bash-4.3$ git log``` --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index f13ee01..8d5064c 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Show git status short](#show-git-status-short) * [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) * [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) +* [Change a branch base](#change-a-branch-base) @@ -1167,5 +1168,10 @@ git checkout master@{yesterday} git push -u origin ``` +## Change a branch base +```sh +git rebase --onto +``` + diff --git a/tips.json b/tips.json index 6de1373..66846f8 100644 --- a/tips.json +++ b/tips.json @@ -493,5 +493,9 @@ }, { "title": "Push a new local branch to remote repository and track", "tip": "git push -u origin " + }, { + "title": "Change a branch base", + "tip": "git rebase --onto " } + ] From c46d4a737ef1b73a7accbc8f6142ab3cba5bf115 Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Tue, 24 Apr 2018 20:04:56 +0100 Subject: [PATCH 222/251] Add first commit from branch alternative --- README.md | 8 +++++++- tips.json | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8d5064c..c553edb 100644 --- a/README.md +++ b/README.md @@ -984,7 +984,13 @@ git log --all --grep='' ## Get first commit in a branch (from master) ```sh -git log master.. --oneline | tail -1 +git log --oneline master.. | tail -1 +``` + + +__Alternatives:__ +```sh +git log --reverse master.. | head -6 ``` ## Unstaging Staged file diff --git a/tips.json b/tips.json index 66846f8..f2e2188 100644 --- a/tips.json +++ b/tips.json @@ -395,7 +395,8 @@ "tip": "git log --all --grep=''" }, { "title": "Get first commit in a branch (from master)", - "tip": "git log master.. --oneline | tail -1" + "tip": "git log --oneline master.. | tail -1", + "alternatives": ["git log --reverse master.. | head -6"] }, { "title": "Unstaging Staged file", "tip": "git reset HEAD " From 96124215b6797018a127d283103c8124b93500b0 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Wed, 25 Jul 2018 11:26:51 +0530 Subject: [PATCH 223/251] Tip: Use SSH instead of HTTPs for remotes. --- README.md | 6 + tips.json | 1002 +++++++++++++++++++++++++++-------------------------- 2 files changed, 508 insertions(+), 500 deletions(-) diff --git a/README.md b/README.md index c553edb..98d158f 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) * [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) * [Change a branch base](#change-a-branch-base) +* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) @@ -1179,5 +1180,10 @@ git push -u origin git rebase --onto ``` +## Use SSH instead of HTTPs for remotes +```sh +git config --global url.'git@github.com:'.insteadOf 'https://github.com/' +``` + diff --git a/tips.json b/tips.json index f2e2188..43accfe 100644 --- a/tips.json +++ b/tips.json @@ -1,502 +1,504 @@ [{ - "title": "Everyday Git in twenty commands or so", - "tip": "git help everyday" -}, { - "title": "Show helpful guides that come with Git", - "tip": "git help -g" -}, { - "title": "Search change by content", - "tip": "git log -S''" -}, { - "title": "Remove sensitive data from history, after a push", - "tip": "git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all" -}, { - "title": "Sync with remote, overwrite local changes", - "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" -}, { - "title": "List of all files till a commit", - "tip": "git ls-tree --name-only -r " -}, { - "title": "Git reset first commit", - "tip": "git update-ref -d HEAD" -}, { - "title": "List all the conflicted files", - "tip": "git diff --name-only --diff-filter=U" -}, { - "title": "List of all files changed in a commit", - "tip": "git diff-tree --no-commit-id --name-only -r " -}, { - "title": "Unstaged changes since last commit", - "tip": "git diff" -}, { - "title": "Changes staged for commit", - "tip": "git diff --cached", - "alternatives": ["git diff --staged"] -}, { - "title": "Show both staged and unstaged changes", - "tip": "git diff HEAD" -}, { - "title": "List all branches that are already merged into master", - "tip": "git branch --merged master" -}, { - "title": "Quickly switch to the previous branch", - "tip": "git checkout -", - "alternatives": ["git checkout @{-1}"] -}, { - "title": "Remove branches that have already been merged with master", - "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", - "alternatives": ["git branch --merged master | grep -v '^\\*\\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out"] -}, { - "title": "List all branches and their upstreams, as well as last commit on branch", - "tip": "git branch -vv" -}, { - "title": "Track upstream branch", - "tip": "git branch -u origin/mybranch" -}, { - "title": "Delete local branch", - "tip": "git branch -d " -}, { - "title": "Delete remote branch", - "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] -}, { - "title": "Delete local tag", - "tip": "git tag -d " -}, { - "title": "Delete remote tag", - "tip": "git push origin :refs/tags/" -}, { - "title": "Undo local changes with the last content in head", - "tip": "git checkout -- " -}, { - "title": "Revert: Undo a commit by creating a new commit", - "tip": "git revert " -}, { - "title": "Reset: Discard commits, advised for private branch", - "tip": "git reset " -}, { - "title": "Reword the previous commit message", - "tip": "git commit -v --amend" -}, { - "title": "See commit history for just the current branch", - "tip": "git cherry -v master" -}, { - "title": "Amend author.", - "tip": "git commit --amend --author='Author Name '" -}, { - "title": "Reset author, after author has been changed in the global config.", - "tip": "git commit --amend --reset-author --no-edit" -}, { - "title": "Changing a remote's URL", - "tip": "git remote set-url origin " -}, { - "title": "Get list of all remote references", - "tip": "git remote", - "alternatives": ["git remote show"] -}, { - "title": "Get list of all local and remote branches", - "tip": "git branch -a" -}, { - "title": "Get only remote branches", - "tip": "git branch -r" -}, { - "title": "Stage parts of a changed file, instead of the entire file", - "tip": "git add -p" -}, { - "title": "Get git bash completion", - "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" -}, { - "title": "What changed since two weeks?", - "tip": "git log --no-merges --raw --since='2 weeks ago'", - "alternatives": ["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 && git cherry-pick " -}, { - "title": "Find out branches containing commit-hash", - "tip": "git branch -a --contains ", - "alternatives": ["git branch --contains "] -}, { - "title": "Git Aliases", - "tip": "git config --global alias. \ngit config --global alias.st status" -}, { - "title": "Saving current state of tracked files without commiting", - "tip": "git stash", - "alternatives": ["git stash save"] -}, { - "title": "Saving current state of unstaged changes to tracked files", - "tip": "git stash -k", - "alternatives": ["git stash --keep-index", "git stash save --keep-index"] -}, { - "title": "Saving current state including untracked files", - "tip": "git stash -u", - "alternatives": ["git stash save -u", "git stash save --include-untracked"] -}, { - "title": "Saving current state with message", - "tip": "git stash save " -}, { - "title": "Saving current state of all files (ignored, untracked, and tracked)", - "tip": "git stash -a", - "alternatives": ["git stash --all", "git stash save --all"] -}, { - "title": "Show list of all saved stashes", - "tip": "git stash list" -}, { - "title": "Apply any stash without deleting from the stashed list", - "tip": "git stash apply " -}, { - "title": "Apply last stashed state and delete it from stashed list", - "tip": "git stash pop", - "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] -}, { - "title": "Delete all stored stashes", - "tip": "git stash clear", - "alternatives": ["git stash drop "] -}, { - "title": "Grab a single file from a stash", - "tip": "git checkout -- ", - "alternatives": ["git checkout stash@{0} -- "] -}, { - "title": "Show all tracked files", - "tip": "git ls-files -t" -}, { - "title": "Show all untracked files", - "tip": "git ls-files --others" -}, { - "title": "Show all ignored files", - "tip": "git ls-files --others -i --exclude-standard" -}, { - "title": "Create new working tree from a repository (git 2.5)", - "tip": "git worktree add -b " -}, { - "title": "Create new working tree from HEAD state", - "tip": "git worktree add --detach HEAD" -}, { - "title": "Untrack files without deleting", - "tip": "git rm --cached ", - "alternatives": ["git rm --cached -r "] -}, { - "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", - "tip": "git clean -n" -}, { - "title": "Forcefully remove untracked files", - "tip": "git clean -f" -}, { - "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d" -}, { - "title": "Update all the submodules", - "tip": "git submodule foreach git pull", - "alternatives": ["git submodule update --init --recursive", "git submodule update --remote"] -}, { - "title": "Show all commits in the current branch yet to be merged to master", - "tip": "git cherry -v master", - "alternatives": ["git cherry -v master "] -}, { - "title": "Rename a branch", - "tip": "git branch -m ", - "alternatives": ["git branch -m [] "] -}, { - "title": "Rebases 'feature' to 'master' and merges it in to master ", - "tip": "git rebase master feature && git checkout master && git merge -" -}, { - "title": "Archive the `master` branch", - "tip": "git archive master --format=zip --output=master.zip" -}, { - "title": "Modify previous commit without modifying the commit message", - "tip": "git add --all && git commit --amend --no-edit" -}, { - "title": "Prunes references to remote branches that have been deleted in the remote.", - "tip": "git fetch -p", - "alternatives": ["git remote prune origin"] -}, { - "title": "Retrieve the commit hash of the initial revision.", - "tip": " git rev-list --reverse HEAD | head -1", - "alternatives": ["git rev-list --max-parents=0 HEAD", "git log --pretty=oneline | tail -1 | cut -c 1-40", "git log --pretty=oneline --reverse | head -1 | cut -c 1-40"] -}, { - "title": "Visualize the version tree.", - "tip": "git log --pretty=oneline --graph --decorate --all", - "alternatives": ["gitk --all","git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'"] -}, { - "title": "Deploying git tracked subfolder to gh-pages", - "tip": "git subtree push --prefix subfolder_name origin gh-pages", - "alternatives": "git subtree push --prefix subfolder_name origin branch_name" -}, { - "title": "Adding a project to repo using subtree", - "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" -}, { - "title": "Get latest changes in your repo for a linked project using subtree", - "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" -}, { - "title": "Export a branch with history to a file.", - "tip": "git bundle create " -}, { - "title": "Import from a bundle", - "tip": "git clone repo.bundle -b " -}, { - "title": "Get the name of current branch.", - "tip": "git rev-parse --abbrev-ref HEAD" -}, { - "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" -}, { - "title": "Fetch pull request by ID to a local branch", - "tip": "git fetch origin pull//head:", - "alternatives": ["git pull origin pull//head:"] -}, { - "title": "Show the most recent tag on the current branch.", - "tip": "git describe --tags --abbrev=0" -}, { - "title": "Show inline word diff.", - "tip": "git diff --word-diff" -}, { - "title": "Show changes using common diff tools.", - "tip": "git difftool [-t ] " -}, { - "title": "Don’t consider changes for tracked file.", - "tip": "git update-index --assume-unchanged " -}, { - "title": "Undo assume-unchanged.", - "tip": "git update-index --no-assume-unchanged " -}, { - "title": "Clean the files from `.gitignore`.", - "tip": "git clean -X -f" -}, { - "title": "Restore deleted file.", - "tip": "git checkout ^ -- " -}, { - "title": "Restore file to a specific commit-hash", - "tip": "git checkout -- " -}, { - "title": "Always rebase instead of merge on pull.", - "tip": "git config --global pull.rebase true", - "alternatives" : ["#git < 1.7.9\ngit config --global branch.autosetuprebase always"] -}, { - "title": "List all the alias and configs.", - "tip": "git config --list" -}, { - "title": "Make git case sensitive.", - "tip": "git config --global core.ignorecase false" -},{ - "title": "Add custom editors.", - "tip": "git config --global core.editor '$EDITOR'" -}, { - "title": "Auto correct typos.", - "tip": "git config --global help.autocorrect 1" -}, { - "title": "Check if the change was a part of a release.", - "tip": "git name-rev --name-only " -}, { - "title": "Dry run. (any command that supports dry-run flag should do.)", - "tip": "git clean -fd --dry-run" -}, { - "title": "Marks your commit as a fix of a previous commit.", - "tip": "git commit --fixup " -}, { - "title": "Squash fixup commits normal commits.", - "tip": "git rebase -i --autosquash" -}, { - "title": "Skip staging area during commit.", - "tip": "git commit --only " -}, { - "title": "Interactive staging.", - "tip": "git add -i" -}, { - "title": "List ignored files.", - "tip": "git check-ignore *" -}, { - "title": "Status of ignored files.", - "tip": "git status --ignored" -}, { - "title": "Commits in Branch1 that are not in Branch2", - "tip": "git log Branch1 ^Branch2" -}, { - "title": "List n last commits", - "tip": "git log -", - "alternatives": ["git log -n "] -}, { - "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", - "tip": "git config --global rerere.enabled 1" -}, { - "title": "Open all conflicted files in an editor.", - "tip": "git diff --name-only | uniq | xargs $EDITOR" -}, { - "title": "Count unpacked number of objects and their disk consumption.", - "tip": "git count-objects --human-readable" -}, { - "title": "Prune all unreachable objects from the object database.", - "tip": "git gc --prune=now --aggressive" -}, { - "title": "Instantly browse your working repository in gitweb.", - "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" -}, { - "title": "View the GPG signatures in the commit log", - "tip": "git log --show-signature" -}, { - "title": "Remove entry in the global config.", - "tip": "git config --global --unset " -}, { - "title": "Checkout a new branch without any history", - "tip": "git checkout --orphan " -}, { - "title": "Extract file from another branch.", - "tip": "git show :" -}, { - "title": "List only the root and merge commits.", - "tip": "git log --first-parent" -}, { - "title": "Change previous two commits with an interactive rebase.", - "tip": "git rebase --interactive HEAD~2" -}, { - "title": "List all branch is WIP", - "tip": "git checkout master && git branch --no-merged" -}, { - "title": "Find guilty with binary search", - "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" -}, { - "title": "Bypass pre-commit and commit-msg githooks", - "tip": "git commit --no-verify" -}, { - "title": "List commits and changes to a specific file (even through renaming)", - "tip": "git log --follow -p -- " -},{ - "title": "Clone a single branch", - "tip": "git clone -b --single-branch https://github.com/user/repo.git" -},{ - "title": "Create and switch new branch", - "tip": "git checkout -b ", - "alternatives": ["git branch && git checkout "] -},{ - "title": "Ignore file mode changes on commits", - "tip": "git config core.fileMode false" -},{ - "title": "Turn off git colored terminal output", - "tip": "git config --global color.ui false" -},{ - "title": "Specific color settings", - "tip": "git config --global " -},{ - "title": "Show all local branches ordered by recent commits", - "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" -},{ - "title": "Find lines matching the pattern (regex or string) in tracked files", - "tip": "git grep --heading --line-number 'foo bar'" -}, { - "title": "Clone a shallow copy of a repository", - "tip": "git clone https://github.com/user/repo.git --depth 1" -}, { - "title": "Search Commit log across all branches for given text", - "tip": "git log --all --grep=''" -}, { - "title": "Get first commit in a branch (from master)", - "tip": "git log --oneline master.. | tail -1", - "alternatives": ["git log --reverse master.. | head -6"] -}, { - "title": "Unstaging Staged file", - "tip": "git reset HEAD " -}, { - "title": "Force push to Remote Repository", - "tip": "git push -f " -}, { - "title": "Adding Remote name", - "tip": "git remote add " -}, { - "title": "Show the author, time and last revision made to each line of a given file", - "tip": "git blame " -}, { - "title": "Group commits by authors and title", - "tip": "git shortlog" -}, { - "title": "Forced push but still ensure you don't overwrite other's work", - "tip": "git push --force-with-lease " -},{ - "title": "Show how many lines does an author contribute", - "tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -", - "alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"] -},{ - "title": "Revert: Reverting an entire merge", - "tip": "git revert -m 1 " -},{ - "title": "Number of commits in a branch", - "tip": "git rev-list --count " -},{ - "title": "Alias: git undo", - "tip": "git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'" -}, { - "title": "Add object notes", - "tip": "git notes add -m 'Note on the previous commit....'" -}, { - "title": "Show all the git-notes", - "tip": "git log --show-notes='*'" -}, { - "title": "Apply commit from another repository", - "tip": "git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k" -},{ - "title": "Specific fetch reference", - "tip": "git fetch origin master:refs/remotes/origin/mymaster" -}, { - "title": "Find common ancestor of two branches", - "tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1" -}, { - "title": "List unpushed git commits", - "tip": "git log --branches --not --remotes", - "alternatives": ["git log @{u}..", "git cherry -v"] -}, { - "title": "Add everything, but whitespace changes", - "tip": "git diff --ignore-all-space | git apply --cached" -}, { - "title": "Edit [local/global] git config", - "tip": "git config [--global] --edit" -}, { - "title": "blame on certain range", - "tip": "git blame -L ," -}, { - "title": "Show a Git logical variable.", - "tip":"git var -l | " -}, { - "title": "Preformatted patch file.", - "tip": "git format-patch -M upstream..topic" -}, { - "title": "Get the repo name.", - "tip": "git rev-parse --show-toplevel" -}, { - "title": "logs between date range", - "tip": "git log --since='FEB 1 2017' --until='FEB 14 2017'" -}, { - "title": "Exclude author from logs", - "tip": "git log --perl-regexp --author='^((?!excluded-author-regex).*)$'" -}, { - "title": "Generates a summary of pending changes", - "tip": "git request-pull v1.0 https://git.ko.xz/project master:for-linus" -}, { - "title":"List references in a remote repository", - "tip": "git ls-remote git://git.kernel.org/pub/scm/git/git.git" -}, { - "title": "Backup untracked files.", - "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" -}, { - "title": "List all git aliases", - "tip": "git config -l | grep alias | sed 's/^alias\\.//g'", - "alternatives": ["git config -l | grep alias | cut -d '.' -f 2"] -},{ - "title": "Show git status short", - "tip": "git status --short --branch" -}, - { - "title": "Checkout a commit prior to a day ago", - "tip": "git checkout master@{yesterday}" - }, { - "title": "Push a new local branch to remote repository and track", - "tip": "git push -u origin " - }, { - "title": "Change a branch base", - "tip": "git rebase --onto " -} - + "title": "Everyday Git in twenty commands or so", + "tip": "git help everyday" + }, { + "title": "Show helpful guides that come with Git", + "tip": "git help -g" + }, { + "title": "Search change by content", + "tip": "git log -S''" + }, { + "title": "Remove sensitive data from history, after a push", + "tip": "git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all" + }, { + "title": "Sync with remote, overwrite local changes", + "tip": "git fetch origin && git reset --hard origin/master && git clean -f -d" + }, { + "title": "List of all files till a commit", + "tip": "git ls-tree --name-only -r " + }, { + "title": "Git reset first commit", + "tip": "git update-ref -d HEAD" + }, { + "title": "List all the conflicted files", + "tip": "git diff --name-only --diff-filter=U" + }, { + "title": "List of all files changed in a commit", + "tip": "git diff-tree --no-commit-id --name-only -r " + }, { + "title": "Unstaged changes since last commit", + "tip": "git diff" + }, { + "title": "Changes staged for commit", + "tip": "git diff --cached", + "alternatives": ["git diff --staged"] + }, { + "title": "Show both staged and unstaged changes", + "tip": "git diff HEAD" + }, { + "title": "List all branches that are already merged into master", + "tip": "git branch --merged master" + }, { + "title": "Quickly switch to the previous branch", + "tip": "git checkout -", + "alternatives": ["git checkout @{-1}"] + }, { + "title": "Remove branches that have already been merged with master", + "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", + "alternatives": ["git branch --merged master | grep -v '^\\*\\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out"] + }, { + "title": "List all branches and their upstreams, as well as last commit on branch", + "tip": "git branch -vv" + }, { + "title": "Track upstream branch", + "tip": "git branch -u origin/mybranch" + }, { + "title": "Delete local branch", + "tip": "git branch -d " + }, { + "title": "Delete remote branch", + "tip": "git push origin --delete ", + "alternatives": ["git push origin :"] + }, { + "title": "Delete local tag", + "tip": "git tag -d " + }, { + "title": "Delete remote tag", + "tip": "git push origin :refs/tags/" + }, { + "title": "Undo local changes with the last content in head", + "tip": "git checkout -- " + }, { + "title": "Revert: Undo a commit by creating a new commit", + "tip": "git revert " + }, { + "title": "Reset: Discard commits, advised for private branch", + "tip": "git reset " + }, { + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" + }, { + "title": "See commit history for just the current branch", + "tip": "git cherry -v master" + }, { + "title": "Amend author.", + "tip": "git commit --amend --author='Author Name '" + }, { + "title": "Reset author, after author has been changed in the global config.", + "tip": "git commit --amend --reset-author --no-edit" + }, { + "title": "Changing a remote's URL", + "tip": "git remote set-url origin " + }, { + "title": "Get list of all remote references", + "tip": "git remote", + "alternatives": ["git remote show"] + }, { + "title": "Get list of all local and remote branches", + "tip": "git branch -a" + }, { + "title": "Get only remote branches", + "tip": "git branch -r" + }, { + "title": "Stage parts of a changed file, instead of the entire file", + "tip": "git add -p" + }, { + "title": "Get git bash completion", + "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" + }, { + "title": "What changed since two weeks?", + "tip": "git log --no-merges --raw --since='2 weeks ago'", + "alternatives": ["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 && git cherry-pick " + }, { + "title": "Find out branches containing commit-hash", + "tip": "git branch -a --contains ", + "alternatives": ["git branch --contains "] + }, { + "title": "Git Aliases", + "tip": "git config --global alias. \ngit config --global alias.st status" + }, { + "title": "Saving current state of tracked files without commiting", + "tip": "git stash", + "alternatives": ["git stash save"] + }, { + "title": "Saving current state of unstaged changes to tracked files", + "tip": "git stash -k", + "alternatives": ["git stash --keep-index", "git stash save --keep-index"] + }, { + "title": "Saving current state including untracked files", + "tip": "git stash -u", + "alternatives": ["git stash save -u", "git stash save --include-untracked"] + }, { + "title": "Saving current state with message", + "tip": "git stash save " + }, { + "title": "Saving current state of all files (ignored, untracked, and tracked)", + "tip": "git stash -a", + "alternatives": ["git stash --all", "git stash save --all"] + }, { + "title": "Show list of all saved stashes", + "tip": "git stash list" + }, { + "title": "Apply any stash without deleting from the stashed list", + "tip": "git stash apply " + }, { + "title": "Apply last stashed state and delete it from stashed list", + "tip": "git stash pop", + "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] + }, { + "title": "Delete all stored stashes", + "tip": "git stash clear", + "alternatives": ["git stash drop "] + }, { + "title": "Grab a single file from a stash", + "tip": "git checkout -- ", + "alternatives": ["git checkout stash@{0} -- "] + }, { + "title": "Show all tracked files", + "tip": "git ls-files -t" + }, { + "title": "Show all untracked files", + "tip": "git ls-files --others" + }, { + "title": "Show all ignored files", + "tip": "git ls-files --others -i --exclude-standard" + }, { + "title": "Create new working tree from a repository (git 2.5)", + "tip": "git worktree add -b " + }, { + "title": "Create new working tree from HEAD state", + "tip": "git worktree add --detach HEAD" + }, { + "title": "Untrack files without deleting", + "tip": "git rm --cached ", + "alternatives": ["git rm --cached -r "] + }, { + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", + "tip": "git clean -n" + }, { + "title": "Forcefully remove untracked files", + "tip": "git clean -f" + }, { + "title": "Forcefully remove untracked directory", + "tip": "git clean -f -d" + }, { + "title": "Update all the submodules", + "tip": "git submodule foreach git pull", + "alternatives": ["git submodule update --init --recursive", "git submodule update --remote"] + }, { + "title": "Show all commits in the current branch yet to be merged to master", + "tip": "git cherry -v master", + "alternatives": ["git cherry -v master "] + }, { + "title": "Rename a branch", + "tip": "git branch -m ", + "alternatives": ["git branch -m [] "] + }, { + "title": "Rebases 'feature' to 'master' and merges it in to master ", + "tip": "git rebase master feature && git checkout master && git merge -" + }, { + "title": "Archive the `master` branch", + "tip": "git archive master --format=zip --output=master.zip" + }, { + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" + }, { + "title": "Prunes references to remote branches that have been deleted in the remote.", + "tip": "git fetch -p", + "alternatives": ["git remote prune origin"] + }, { + "title": "Retrieve the commit hash of the initial revision.", + "tip": " git rev-list --reverse HEAD | head -1", + "alternatives": ["git rev-list --max-parents=0 HEAD", "git log --pretty=oneline | tail -1 | cut -c 1-40", "git log --pretty=oneline --reverse | head -1 | cut -c 1-40"] + }, { + "title": "Visualize the version tree.", + "tip": "git log --pretty=oneline --graph --decorate --all", + "alternatives": ["gitk --all", "git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'"] + }, { + "title": "Deploying git tracked subfolder to gh-pages", + "tip": "git subtree push --prefix subfolder_name origin gh-pages", + "alternatives": "git subtree push --prefix subfolder_name origin branch_name" + }, { + "title": "Adding a project to repo using subtree", + "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" + }, { + "title": "Get latest changes in your repo for a linked project using subtree", + "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" + }, { + "title": "Export a branch with history to a file.", + "tip": "git bundle create " + }, { + "title": "Import from a bundle", + "tip": "git clone repo.bundle -b " + }, { + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" + }, { + "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" + }, { + "title": "Fetch pull request by ID to a local branch", + "tip": "git fetch origin pull//head:", + "alternatives": ["git pull origin pull//head:"] + }, { + "title": "Show the most recent tag on the current branch.", + "tip": "git describe --tags --abbrev=0" + }, { + "title": "Show inline word diff.", + "tip": "git diff --word-diff" + }, { + "title": "Show changes using common diff tools.", + "tip": "git difftool [-t ] " + }, { + "title": "Don’t consider changes for tracked file.", + "tip": "git update-index --assume-unchanged " + }, { + "title": "Undo assume-unchanged.", + "tip": "git update-index --no-assume-unchanged " + }, { + "title": "Clean the files from `.gitignore`.", + "tip": "git clean -X -f" + }, { + "title": "Restore deleted file.", + "tip": "git checkout ^ -- " + }, { + "title": "Restore file to a specific commit-hash", + "tip": "git checkout -- " + }, { + "title": "Always rebase instead of merge on pull.", + "tip": "git config --global pull.rebase true", + "alternatives": ["#git < 1.7.9\ngit config --global branch.autosetuprebase always"] + }, { + "title": "List all the alias and configs.", + "tip": "git config --list" + }, { + "title": "Make git case sensitive.", + "tip": "git config --global core.ignorecase false" + }, { + "title": "Add custom editors.", + "tip": "git config --global core.editor '$EDITOR'" + }, { + "title": "Auto correct typos.", + "tip": "git config --global help.autocorrect 1" + }, { + "title": "Check if the change was a part of a release.", + "tip": "git name-rev --name-only " + }, { + "title": "Dry run. (any command that supports dry-run flag should do.)", + "tip": "git clean -fd --dry-run" + }, { + "title": "Marks your commit as a fix of a previous commit.", + "tip": "git commit --fixup " + }, { + "title": "Squash fixup commits normal commits.", + "tip": "git rebase -i --autosquash" + }, { + "title": "Skip staging area during commit.", + "tip": "git commit --only " + }, { + "title": "Interactive staging.", + "tip": "git add -i" + }, { + "title": "List ignored files.", + "tip": "git check-ignore *" + }, { + "title": "Status of ignored files.", + "tip": "git status --ignored" + }, { + "title": "Commits in Branch1 that are not in Branch2", + "tip": "git log Branch1 ^Branch2" + }, { + "title": "List n last commits", + "tip": "git log -", + "alternatives": ["git log -n "] + }, { + "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", + "tip": "git config --global rerere.enabled 1" + }, { + "title": "Open all conflicted files in an editor.", + "tip": "git diff --name-only | uniq | xargs $EDITOR" + }, { + "title": "Count unpacked number of objects and their disk consumption.", + "tip": "git count-objects --human-readable" + }, { + "title": "Prune all unreachable objects from the object database.", + "tip": "git gc --prune=now --aggressive" + }, { + "title": "Instantly browse your working repository in gitweb.", + "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" + }, { + "title": "View the GPG signatures in the commit log", + "tip": "git log --show-signature" + }, { + "title": "Remove entry in the global config.", + "tip": "git config --global --unset " + }, { + "title": "Checkout a new branch without any history", + "tip": "git checkout --orphan " + }, { + "title": "Extract file from another branch.", + "tip": "git show :" + }, { + "title": "List only the root and merge commits.", + "tip": "git log --first-parent" + }, { + "title": "Change previous two commits with an interactive rebase.", + "tip": "git rebase --interactive HEAD~2" + }, { + "title": "List all branch is WIP", + "tip": "git checkout master && git branch --no-merged" + }, { + "title": "Find guilty with binary search", + "tip": "git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n" + }, { + "title": "Bypass pre-commit and commit-msg githooks", + "tip": "git commit --no-verify" + }, { + "title": "List commits and changes to a specific file (even through renaming)", + "tip": "git log --follow -p -- " + }, { + "title": "Clone a single branch", + "tip": "git clone -b --single-branch https://github.com/user/repo.git" + }, { + "title": "Create and switch new branch", + "tip": "git checkout -b ", + "alternatives": ["git branch && git checkout "] + }, { + "title": "Ignore file mode changes on commits", + "tip": "git config core.fileMode false" + }, { + "title": "Turn off git colored terminal output", + "tip": "git config --global color.ui false" + }, { + "title": "Specific color settings", + "tip": "git config --global " + }, { + "title": "Show all local branches ordered by recent commits", + "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" + }, { + "title": "Find lines matching the pattern (regex or string) in tracked files", + "tip": "git grep --heading --line-number 'foo bar'" + }, { + "title": "Clone a shallow copy of a repository", + "tip": "git clone https://github.com/user/repo.git --depth 1" + }, { + "title": "Search Commit log across all branches for given text", + "tip": "git log --all --grep=''" + }, { + "title": "Get first commit in a branch (from master)", + "tip": "git log --oneline master.. | tail -1", + "alternatives": ["git log --reverse master.. | head -6"] + }, { + "title": "Unstaging Staged file", + "tip": "git reset HEAD " + }, { + "title": "Force push to Remote Repository", + "tip": "git push -f " + }, { + "title": "Adding Remote name", + "tip": "git remote add " + }, { + "title": "Show the author, time and last revision made to each line of a given file", + "tip": "git blame " + }, { + "title": "Group commits by authors and title", + "tip": "git shortlog" + }, { + "title": "Forced push but still ensure you don't overwrite other's work", + "tip": "git push --force-with-lease " + }, { + "title": "Show how many lines does an author contribute", + "tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -", + "alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"] + }, { + "title": "Revert: Reverting an entire merge", + "tip": "git revert -m 1 " + }, { + "title": "Number of commits in a branch", + "tip": "git rev-list --count " + }, { + "title": "Alias: git undo", + "tip": "git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'" + }, { + "title": "Add object notes", + "tip": "git notes add -m 'Note on the previous commit....'" + }, { + "title": "Show all the git-notes", + "tip": "git log --show-notes='*'" + }, { + "title": "Apply commit from another repository", + "tip": "git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k" + }, { + "title": "Specific fetch reference", + "tip": "git fetch origin master:refs/remotes/origin/mymaster" + }, { + "title": "Find common ancestor of two branches", + "tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1" + }, { + "title": "List unpushed git commits", + "tip": "git log --branches --not --remotes", + "alternatives": ["git log @{u}..", "git cherry -v"] + }, { + "title": "Add everything, but whitespace changes", + "tip": "git diff --ignore-all-space | git apply --cached" + }, { + "title": "Edit [local/global] git config", + "tip": "git config [--global] --edit" + }, { + "title": "blame on certain range", + "tip": "git blame -L ," + }, { + "title": "Show a Git logical variable.", + "tip": "git var -l | " + }, { + "title": "Preformatted patch file.", + "tip": "git format-patch -M upstream..topic" + }, { + "title": "Get the repo name.", + "tip": "git rev-parse --show-toplevel" + }, { + "title": "logs between date range", + "tip": "git log --since='FEB 1 2017' --until='FEB 14 2017'" + }, { + "title": "Exclude author from logs", + "tip": "git log --perl-regexp --author='^((?!excluded-author-regex).*)$'" + }, { + "title": "Generates a summary of pending changes", + "tip": "git request-pull v1.0 https://git.ko.xz/project master:for-linus" + }, { + "title": "List references in a remote repository", + "tip": "git ls-remote git://git.kernel.org/pub/scm/git/git.git" + }, { + "title": "Backup untracked files.", + "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" + }, { + "title": "List all git aliases", + "tip": "git config -l | grep alias | sed 's/^alias\\.//g'", + "alternatives": ["git config -l | grep alias | cut -d '.' -f 2"] + }, { + "title": "Show git status short", + "tip": "git status --short --branch" + }, + { + "title": "Checkout a commit prior to a day ago", + "tip": "git checkout master@{yesterday}" + }, { + "title": "Push a new local branch to remote repository and track", + "tip": "git push -u origin " + }, { + "title": "Change a branch base", + "tip": "git rebase --onto " + }, { + "title": "Use SSH instead of HTTPs for remotes", + "tip": "git config --global url.'git@github.com:'.insteadOf 'https://github.com/'" + } ] From 94b41fd43768407d11908e708e23b575f389d51a Mon Sep 17 00:00:00 2001 From: lmarvaud <24732919+lmarvaud@users.noreply.github.com> Date: Fri, 5 Oct 2018 15:34:42 +0200 Subject: [PATCH 224/251] Visualize the tree including commits that are only referenced from reflogs --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 98d158f..a06300d 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) * [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](#visualize-the-version-tree) +* [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs) * [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages) * [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree) * [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) @@ -672,6 +673,11 @@ gitk --all git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d' ``` +## Visualize the tree including commits that are only referenced from reflogs +```sh +git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all) +``` + ## Deploying git tracked subfolder to gh-pages ```sh git subtree push --prefix subfolder_name origin gh-pages diff --git a/tips.json b/tips.json index 43accfe..9909931 100644 --- a/tips.json +++ b/tips.json @@ -220,6 +220,9 @@ "title": "Visualize the version tree.", "tip": "git log --pretty=oneline --graph --decorate --all", "alternatives": ["gitk --all", "git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'"] + }, { + "title": "Visualize the tree including commits that are only referenced from reflogs", + "tip": "git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all)" }, { "title": "Deploying git tracked subfolder to gh-pages", "tip": "git subtree push --prefix subfolder_name origin gh-pages", From 03f10d90fe504eb8cc2a619a48ca5360c0d0b0ef Mon Sep 17 00:00:00 2001 From: Marielle Volz Date: Mon, 5 Nov 2018 12:22:26 +0000 Subject: [PATCH 225/251] Add -L to follow redirects As per the comments in #154, use -L to follow the redirect for curl. The tip as written does not currently work as it downloads the html for the redirect page instead. --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 43accfe..7bef1dd 100644 --- a/tips.json +++ b/tips.json @@ -104,7 +104,7 @@ "tip": "git add -p" }, { "title": "Get git bash completion", - "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" + "tip": "curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" }, { "title": "What changed since two weeks?", "tip": "git log --no-merges --raw --since='2 weeks ago'", From bc2805558507499f137ff25009d1253d707f0654 Mon Sep 17 00:00:00 2001 From: Marielle Volz Date: Mon, 5 Nov 2018 12:25:32 +0000 Subject: [PATCH 226/251] Fix to follow redirect As per #154, change to -L so that the redirect gets followed. As written this line downloads the html redirect page. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98d158f..09890d9 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ git add -p ## Get git bash completion ```sh -curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc +curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` ## What changed since two weeks? From a536d928568c4053d377952f4bd55ea8818577c9 Mon Sep 17 00:00:00 2001 From: "taisuke.isobe" Date: Wed, 2 Jan 2019 15:02:25 +0900 Subject: [PATCH 227/251] add japanese translation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d158611..214852e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) ### __Tools:__ From c333d5516f0cc47d2bd130cfcdf5edd4dfaea27c Mon Sep 17 00:00:00 2001 From: Steve Nolte Date: Fri, 18 Jan 2019 10:34:23 -0600 Subject: [PATCH 228/251] Change to the simpler merge-base command Good to showcase this command as it also provides additional features like --fork-point and --all. --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 214852e..688d835 100644 --- a/README.md +++ b/README.md @@ -1080,7 +1080,7 @@ git fetch origin master:refs/remotes/origin/mymaster ## Find common ancestor of two branches ```sh -diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1 +git merge-base ``` ## List unpushed git commits diff --git a/tips.json b/tips.json index ea1ee54..4ecadbe 100644 --- a/tips.json +++ b/tips.json @@ -445,7 +445,7 @@ "tip": "git fetch origin master:refs/remotes/origin/mymaster" }, { "title": "Find common ancestor of two branches", - "tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1" + "tip": "git merge-base " }, { "title": "List unpushed git commits", "tip": "git log --branches --not --remotes", From b3cb087c3462d724dc3e8cf3a7ef7ece6f7d76b9 Mon Sep 17 00:00:00 2001 From: alizduwal Date: Wed, 20 Mar 2019 13:48:45 +0545 Subject: [PATCH 229/251] Add Nepali Localization --- README.md | 2 +- package-lock.json | 301 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/README.md b/README.md index 688d835..fb6717c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) ### __Tools:__ diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2ca1e1c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,301 @@ +{ + "name": "tips", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "101": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/101/-/101-1.6.3.tgz", + "integrity": "sha512-4dmQ45yY0Dx24Qxp+zAsNLlMF6tteCyfVzgbulvSyC7tCyd3V8sW76sS0tHq8NpcbXfWTKasfyfzU1Kd86oKzw==", + "dev": true, + "requires": { + "clone": "^1.0.2", + "deep-eql": "^0.1.3", + "keypather": "^1.10.2" + } + }, + "1-liners": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/1-liners/-/1-liners-0.3.6.tgz", + "integrity": "sha1-SDD+eLdTejaZ+IpdQqjtwa9mB/8=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "dev": true + }, + "base64-js": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz", + "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q=", + "dev": true + }, + "bops": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.6.tgz", + "integrity": "sha1-CC0dVfoB5g29wuvC26N/ZZVUzzo=", + "dev": true, + "requires": { + "base64-js": "0.0.2", + "to-utf8": "0.0.1" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "concat-stream": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.2.1.tgz", + "integrity": "sha1-81EAtsRjeL+6i2uA+fDQzN8T3GA=", + "dev": true, + "requires": { + "bops": "0.0.6" + } + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "doxie": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/doxie/-/doxie-0.2.4.tgz", + "integrity": "sha1-KZltv1dg/OdNvLTXnGAjHYoXu4U=", + "dev": true, + "requires": { + "1-liners": "^0.3.2", + "chalk": "^1.0.0", + "doxie-core": "^0.3.1", + "stream-to-json": "^0.0.1", + "tiny-error": "^0.2.1" + } + }, + "doxie-core": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/doxie-core/-/doxie-core-0.3.1.tgz", + "integrity": "sha1-PS+RQ+WF45Cpgwjcnk7zjxPPQss=", + "dev": true, + "requires": { + "1-liners": "^0.3.0", + "chalk": "^1.0.0", + "tiny-error": "^0.2.1" + } + }, + "doxie.append": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/doxie.append/-/doxie.append-0.1.0.tgz", + "integrity": "sha1-yHRoUEL18wlKTQwzNsPklMNpdOE=", + "dev": true, + "requires": { + "object-assign": "^3.0.0" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "doxie.inject": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/doxie.inject/-/doxie.inject-0.1.1.tgz", + "integrity": "sha1-/QNYT4segOZEtcuUdpr+RH94oEc=", + "dev": true, + "requires": { + "1-liners": "^0.3.2", + "array-find": "^1.0.0", + "chalk": "^1.0.0", + "defined": "^1.0.0", + "object-assign": "^3.0.0", + "tiny-error": "^0.2.1" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "doxie.output": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/doxie.output/-/doxie.output-0.3.0.tgz", + "integrity": "sha1-4H4Stn2qX8KLPsZn0HAv1ziZitE=", + "dev": true, + "requires": { + "1-liners": "^0.3.0", + "object-assign": "^3.0.0" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "doxie.render": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/doxie.render/-/doxie.render-0.3.2.tgz", + "integrity": "sha1-Mva37g88NSSokT08grn6uqoKGPA=", + "dev": true, + "requires": { + "1-liners": "^0.3.1", + "chalk": "^1.0.0", + "object-assign": "^3.0.0", + "tiny-error": "^0.2.1" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "husky": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.8.1.tgz", + "integrity": "sha1-7MeXuMTGiToz9IcDvJeppeUNhg8=", + "dev": true + }, + "keypather": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/keypather/-/keypather-1.10.2.tgz", + "integrity": "sha1-4ESWMtSz5RbyHMAUznxWRP3c5hQ=", + "dev": true, + "requires": { + "101": "^1.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "stream-to-json": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/stream-to-json/-/stream-to-json-0.0.1.tgz", + "integrity": "sha1-8DDyt47TjkkpPbiFZTarzCZ3FHM=", + "dev": true, + "requires": { + "concat-stream": "~1.2.0", + "once": "~1.3.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tiny-error": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tiny-error/-/tiny-error-0.2.3.tgz", + "integrity": "sha1-KHas/leFGwcUMTwVNd/HBgp8Cbs=", + "dev": true, + "requires": { + "101": "^1.0.0", + "object-assign": "^4.0.1" + } + }, + "to-utf8": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz", + "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI=", + "dev": true + }, + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} From 679bf0a1d7dcba4d7c92738488fb1795e9f6738d Mon Sep 17 00:00:00 2001 From: alizduwal Date: Fri, 22 Mar 2019 18:37:15 +0545 Subject: [PATCH 230/251] Tips for log, reset and list currently configuyre remotes --- tips.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 4ecadbe..8e7f434 100644 --- a/tips.json +++ b/tips.json @@ -7,6 +7,9 @@ }, { "title": "Search change by content", "tip": "git log -S''" + }, { + "title": "Show changes over time for specific file", + "tip": "git log -p " }, { "title": "Remove sensitive data from history, after a push", "tip": "git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all" @@ -19,6 +22,9 @@ }, { "title": "Git reset first commit", "tip": "git update-ref -d HEAD" + }, { + "title": "Reset: preserve uncommitted local changes", + "tip": "git reset --keep " }, { "title": "List all the conflicted files", "tip": "git diff --name-only --diff-filter=U" @@ -58,7 +64,7 @@ }, { "title": "Delete remote branch", "tip": "git push origin --delete ", - "alternatives": ["git push origin :"] + "alternatives": ["git push origin :", "git branch -dr "] }, { "title": "Delete local tag", "tip": "git tag -d " @@ -409,6 +415,9 @@ }, { "title": "Adding Remote name", "tip": "git remote add " + }, { + "title": "List all currently configured remotes", + "tip": "git remote -v" }, { "title": "Show the author, time and last revision made to each line of a given file", "tip": "git blame " From ebde7ca24bc847aaaf5560eb5e75a45df14d5398 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 18 Apr 2019 11:43:06 +0300 Subject: [PATCH 231/251] tips.json: submodule to latest commit --- README.md | 33 +++++++++++++++++++++++++++++++++ tips.json | 5 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb6717c..4f18925 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,12 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) * [Search change by content](#search-change-by-content) +* [Show changes over time for specific file](#show-changes-over-time-for-specific-file) * [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push) * [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes) * [List of all files till a commit](#list-of-all-files-till-a-commit) * [Git reset first commit](#git-reset-first-commit) +* [Reset: preserve uncommitted local changes](#reset-preserve-uncommitted-local-changes) * [List all the conflicted files](#list-all-the-conflicted-files) * [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit) * [Unstaged changes since last commit](#unstaged-changes-since-last-commit) @@ -139,6 +141,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Unstaging Staged file](#unstaging-staged-file) * [Force push to Remote Repository](#force-push-to-remote-repository) * [Adding Remote name](#adding-remote-name) +* [List all currently configured remotes](#list-all-currently-configured-remotes) * [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) * [Group commits by authors and title](#group-commits-by-authors-and-title) * [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) @@ -169,6 +172,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) * [Change a branch base](#change-a-branch-base) * [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) +* [Update a submodule to the latest commit](#update-a-submodule-to-the-latest-commit) @@ -191,6 +195,11 @@ git help -g git log -S'' ``` +## Show changes over time for specific file +```sh +git log -p +``` + ## Remove sensitive data from history, after a push ```sh git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all @@ -211,6 +220,11 @@ git ls-tree --name-only -r git update-ref -d HEAD ``` +## Reset: preserve uncommitted local changes +```sh +git reset --keep +``` + ## List all the conflicted files ```sh git diff --name-only --diff-filter=U @@ -295,6 +309,11 @@ __Alternatives:__ git push origin : ``` + +```sh +git branch -dr +``` + ## Delete local tag ```sh git tag -d @@ -1015,6 +1034,11 @@ git push -f git remote add ``` +## List all currently configured remotes +```sh +git remote -v +``` + ## Show the author, time and last revision made to each line of a given file ```sh git blame @@ -1191,5 +1215,14 @@ git rebase --onto git config --global url.'git@github.com:'.insteadOf 'https://github.com/' ``` +## Update a submodule to the latest commit +```sh +cd +git pull origin +cd +git add +git commit -m "submodule updated" +``` + diff --git a/tips.json b/tips.json index 8e7f434..6a1a001 100644 --- a/tips.json +++ b/tips.json @@ -512,5 +512,8 @@ }, { "title": "Use SSH instead of HTTPs for remotes", "tip": "git config --global url.'git@github.com:'.insteadOf 'https://github.com/'" - } + }, { + "title": "Update a submodule to the latest commit", + "tip": "cd \ngit pull origin \ncd \ngit add \ngit commit -m \"submodule updated\"" + } ] From a9d29fb4bc18aee51047cf01c28efc39a056c220 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 Jul 2019 23:09:35 +0900 Subject: [PATCH 232/251] Add Prevent auto replacing LF with CRLF --- README.md | 6 ++++++ tips.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f18925..0e69629 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Change a branch base](#change-a-branch-base) * [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) * [Update a submodule to the latest commit](#update-a-submodule-to-the-latest-commit) +* [Prevent auto replacing LF with CRLF](#prevent-auto-replacing-lf-with-crlf) @@ -1224,5 +1225,10 @@ git add git commit -m "submodule updated" ``` +## Prevent auto replacing LF with CRLF +```sh +git config --global core.autocrlf false +``` + diff --git a/tips.json b/tips.json index 6a1a001..3400539 100644 --- a/tips.json +++ b/tips.json @@ -515,5 +515,8 @@ }, { "title": "Update a submodule to the latest commit", "tip": "cd \ngit pull origin \ncd \ngit add \ngit commit -m \"submodule updated\"" - } + }, { + "title": "Prevent auto replacing LF with CRLF", + "tip": "git config --global core.autocrlf false" + } ] From 512ec7764c194d61e06e4f411a2e04ecfd06c92a Mon Sep 17 00:00:00 2001 From: Michal Date: Sat, 4 Apr 2020 16:32:08 +0200 Subject: [PATCH 233/251] [WIP] Polish version (#180) * update README.md first changes * update README.md few changes * update readme changed until git-stash * update readme updated until 987L * update readme updated internal links * update readme updated internal links * update readme small fix * update readme updated with internal links * update readme small fixes * update readme small fix * update readme small fixes --- README.md | 698 +++++++++++++++++++++++++++--------------------------- 1 file changed, 349 insertions(+), 349 deletions(-) diff --git a/README.md b/README.md index 0e69629..7ff3c8b 100644 --- a/README.md +++ b/README.md @@ -1,179 +1,179 @@ ## git-tips -> Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) +> Kolekcja`git-tips`, chcesz dodać swoje wskazówki? Sprawdź [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) | [Polski](https://github.com/mbiesiad/tips) -### __Tools:__ +### __Narzędzia:__ -* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. ([Here in Docker container](https://github.com/djoudi5/docker-git-tip)) +* [git-tip](https://www.npmjs.com/package/git-tip) - Poręczny interfejs CLI umożliwiający optymalne wykorzystanie tych wskazówek. ([Tutaj jest kontener Docker](https://github.com/djoudi5/docker-git-tip)) -P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. +P.S: Wszystkie te polecenia są testowane na `git version 2.7.4 (Apple Git-66)`. -* [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) -* [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) -* [Search change by content](#search-change-by-content) -* [Show changes over time for specific file](#show-changes-over-time-for-specific-file) -* [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push) -* [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes) -* [List of all files till a commit](#list-of-all-files-till-a-commit) -* [Git reset first commit](#git-reset-first-commit) -* [Reset: preserve uncommitted local changes](#reset-preserve-uncommitted-local-changes) -* [List all the conflicted files](#list-all-the-conflicted-files) -* [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit) -* [Unstaged changes since last commit](#unstaged-changes-since-last-commit) -* [Changes staged for commit](#changes-staged-for-commit) -* [Show both staged and unstaged changes](#show-both-staged-and-unstaged-changes) -* [List all branches that are already merged into master](#list-all-branches-that-are-already-merged-into-master) -* [Quickly switch to the previous branch](#quickly-switch-to-the-previous-branch) -* [Remove branches that have already been merged with master](#remove-branches-that-have-already-been-merged-with-master) -* [List all branches and their upstreams, as well as last commit on branch](#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) -* [Track upstream branch](#track-upstream-branch) -* [Delete local branch](#delete-local-branch) -* [Delete remote branch](#delete-remote-branch) -* [Delete local tag](#delete-local-tag) -* [Delete remote tag](#delete-remote-tag) -* [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head) -* [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit) -* [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch) -* [Reword the previous commit message](#reword-the-previous-commit-message) -* [See commit history for just the current branch](#see-commit-history-for-just-the-current-branch) -* [Amend author.](#amend-author) -* [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config) -* [Changing a remote's URL](#changing-a-remotes-url) -* [Get list of all remote references](#get-list-of-all-remote-references) -* [Get list of all local and remote branches](#get-list-of-all-local-and-remote-branches) -* [Get only remote branches](#get-only-remote-branches) -* [Stage parts of a changed file, instead of the entire file](#stage-parts-of-a-changed-file-instead-of-the-entire-file) -* [Get git bash completion](#get-git-bash-completion) -* [What changed since two weeks?](#what-changed-since-two-weeks) -* [See all commits made since forking from master](#see-all-commits-made-since-forking-from-master) -* [Pick commits across branches using cherry-pick](#pick-commits-across-branches-using-cherry-pick) -* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash) -* [Git Aliases](#git-aliases) -* [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) -* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files) -* [Saving current state including untracked files](#saving-current-state-including-untracked-files) -* [Saving current state with message](#saving-current-state-with-message) -* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked) -* [Show list of all saved stashes](#show-list-of-all-saved-stashes) -* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) -* [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) -* [Delete all stored stashes](#delete-all-stored-stashes) -* [Grab a single file from a stash](#grab-a-single-file-from-a-stash) -* [Show all tracked files](#show-all-tracked-files) -* [Show all untracked files](#show-all-untracked-files) -* [Show all ignored files](#show-all-ignored-files) -* [Create new working tree from a repository (git 2.5)](#create-new-working-tree-from-a-repository-git-25) -* [Create new working tree from HEAD state](#create-new-working-tree-from-head-state) -* [Untrack files without deleting](#untrack-files-without-deleting) -* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) -* [Forcefully remove untracked files](#forcefully-remove-untracked-files) -* [Forcefully remove untracked directory](#forcefully-remove-untracked-directory) -* [Update all the submodules](#update-all-the-submodules) -* [Show all commits in the current branch yet to be merged to master](#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) -* [Rename a branch](#rename-a-branch) -* [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) -* [Archive the `master` branch](#archive-the-master-branch) -* [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message) -* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) -* [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision) -* [Visualize the version tree.](#visualize-the-version-tree) -* [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs) -* [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages) -* [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree) -* [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) -* [Export a branch with history to a file.](#export-a-branch-with-history-to-a-file) -* [Import from a bundle](#import-from-a-bundle) -* [Get the name of current branch.](#get-the-name-of-current-branch) -* [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog) -* [Stash changes before rebasing](#stash-changes-before-rebasing) -* [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch) -* [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch) -* [Show inline word diff.](#show-inline-word-diff) -* [Show changes using common diff tools.](#show-changes-using-common-diff-tools) -* [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file) -* [Undo assume-unchanged.](#undo-assume-unchanged) -* [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore) -* [Restore deleted file.](#restore-deleted-file) -* [Restore file to a specific commit-hash](#restore-file-to-a-specific-commit-hash) -* [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull) -* [List all the alias and configs.](#list-all-the-alias-and-configs) -* [Make git case sensitive.](#make-git-case-sensitive) -* [Add custom editors.](#add-custom-editors) -* [Auto correct typos.](#auto-correct-typos) -* [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release) -* [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do) -* [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit) +* [Codziennie Git w około dwudziestu poleceniach](#codziennie-git-w-około-dwudziestu-poleceniach) +* [Pokaż przydatne przewodniki dla Git](#pokaż-przydatne-przewodniki-dla-git) +* [Wyszukaj zmianę według zawartości](#wyszukaj-zmianę-według-zawartości) +* [Pokaż zmiany w czasie dla określonego pliku](#pokaż-zmiany-w-czasie-dla-określonego-pliku) +* [Usuń wrażliwe dane z historii po push](#usuń-wrażliwe-dane-z-historii-po-push) +* [Synchronizuj ze zdalnym, zastępuj lokalne zmiany](#synchronizuj-ze-zdalnym-zastępuj-lokalne-zmiany) +* [Lista wszystkich plików do commita](#lista-wszystkich-plików-do-commita) +* [Git zresetuj pierwszy commit](#git-zresetuj-pierwszy-commit) +* [Reset: zachowaj niezatwierdzone zmiany lokalne](#reset-zachowaj-niezatwierdzone-zmiany-lokalne) +* [Wyświetl wszystkie skonfliktowane pliki](#wyświetl-wszystkie-skonfliktowane-pliki) +* [Lista wszystkich plików zmienionych w commitcie](#lista-wszystkich-plików-zmienionych-w-commitcie) +* [Zmienione ale niezaktualizowane zmiany od ostatniego zatwierdzenia](#zmienione-ale-niezaktualizowane-zmiany-od-ostatniego-zatwierdzenia) +* [Porównanie zmian z poczekalni z ostatnią zmianą](#porównanie-zmian-z-poczekalni-z-ostatnią-zmianą) +* [Pokaż wszystkie zmiany w śledzonych plikach.](#pokaż-wszystkie-zmiany-w-śledzonych-plikach) +* [Lista wszystkich gałęzi, które są już zmergowane do mastera](#lista-wszystkich-gałęzi-które-są-już-zmergowane-do-mastera) +* [Szybko przełącz na poprzednią gałąź](#szybko-przełącz-na-poprzednią-gałąź) +* [Usuń gałęzie które zostały już połączone z master](#usuń-gałęzie-które-zostały-już-połączone-z-master) +* [Wymień wszystkie gałęzie i ich wyższe poziomy, a także ostatnie zatwierdzenie na gałęzi](#wymień-wszystkie-gałęzie-i-ich-wyższe-poziomy-a-także-ostatnie-zatwierdzenie-na-gałęzi) +* [Śledź odgałęzienie](#śledź-odgałęzienie) +* [Usuń lokalną gałąź](#usuń-lokalną-gałąź) +* [Usuń zdalną gałąź](#usuń-zdalną-gałąź) +* [Usuń lokalny tag](#usuń-lokalny-tag) +* [Usuń zdalny tag](#usuń-zdalny-tag) +* [Cofnij zmiany lokalne z ostatnią zawartością w head](#cofnij-zmiany-lokalne-z-ostatnią-zawartością-w-head) +* [Cofnij: Cofnij commita, tworząc nowego commita](#cofnij-cofnij-commita-tworząc-nowego-commita) +* [Reset: Odrzuć commity, zalecane dla prywatnej gałęzi](#reset-odrzuć-commity-zalecane-dla-prywatnej-gałęzi) +* [Zmień kolejność poprzedniej wiadomości commita](#zmień-kolejność-poprzedniej-wiadomości-commita) +* [Zobacz historię zatwierdzeń tylko dla bieżącej gałęzi](#zobacz-historię-zatwierdzeń-tylko-dla-bieżącej-gałęzi) +* [Zmień autora.](#zmień-autora) +* [Resetuj autora po zmianie autora w global config.](#resetuj-autora-po-zmianie-autora-w-global-config) +* [Zmiana zdalnego adresu URL](#zmiana-zdalnego-adresu-URL) +* [Uzyskaj listę wszystkich zdalnych referencji](#uzyskaj-listę-wszystkich-zdalnych-referencji) +* [Uzyskaj listę wszystkich lokalnych i zdalnych gałęzi](#uzyskaj-listę-wszystkich-lokalnych-i-zdalnych-gałęzi) +* [Uzyskaj tylko zdalne gałęzie](#uzyskaj-tylko-zdalne-gałęzie) +* [Śledź części zmienionego pliku zamiast całego pliku](#śledź-części-zmienionego-pliku-zamiast-całego-pliku) +* [Uzyskaj ukończenie git bash](#uzyskaj-ukończenie-git-bash) +* [Co zmieniło się od dwóch tygodni?](#co-zmieniło-się-od-dwóch-tygodni) +* [Zobacz wszystkie zatwierdzenia dokonane od czasu forkowania z mastera](#zobacz-wszystkie-zatwierdzenia-dokonane-od-czasu-forkowania-z-mastera) +* [Wybierz zatwierdzenia między gałęziami za pomocą cherry-pick](#wybierz-zatwierdzenia-między-gałęziami-za-pomocą-cherry-pick) +* [Znajdź gałęzie zawierające commit-hash](#znajdź-gałęzie-zawierające-commit-hash) +* [Aliasy Gita](#aliasy-gita) +* [Zapisywanie bieżącego stanu śledzonych plików bez zatwierdzania](#zapisywanie-bieżącego-stanu-śledzonych-plików-bez-zatwierdzania) +* [Zapisywanie aktualnego stanu zmian unstaged do śledzonych plików](#zapisywanie-aktualnego-stanu-zmian-unstaged-do-śledzonych-plików) +* [Zapisywanie bieżącego stanu, w tym nieśledzonych plików](#zapisywanie-bieżącego-stanu-w-tym-nieśledzonych-plików) +* [Zapisywanie aktualnego stanu z komunikatem](#zapisywanie-aktualnego-stanu-z-komunikatem) +* [Zapisywanie bieżącego stanu wszystkich plików (ignorowanych, nieśledzonych i śledzonych)](#zapisywanie-bieżącego-stanu-wszystkich-plików-ignorowanych-nieśledzonych-i-śledzonych) +* [Pokaż listę wszystkich zapisanych stashes](#pokaż-listę-wszystkich-zapisanych-stashes) +* [Zastosuj dowolony stash bez usuwania z listy stashed](#zastosuj-dowolony-stash-bez-usuwania-z-listy-stashed) +* [Zastosuj ostatni stan stashed i usuń go z listy stashed](#zastosuj-ostatni-stan-stashed-i-usuń-go-z-listy-stashed) +* [Usuń wszystkie przechowywane stashes](#usuń-wszystkie-przechowywane-stashes) +* [Weź pojedynczy plik z pliku stash](#weź-pojedynczy-plik-z-pliku-stash) +* [Pokaż wszystkie śledzone pliki](#pokaż-wszystkie-śledzone-pliki) +* [Pokaż wszystkie nieśledzone pliki](#pokaż-wszystkie-nieśledzone-pliki) +* [Pokaż wszystkie zignorowane pliki](#pokaż-wszystkie-zignorowane-pliki) +* [Utwórz nowe drzewo robocze z repozytorium (git 2.5)](#utwórz-nowe-drzewo-robocze-z-repozytorium-git-2-5) +* [Utwórz nowe drzewo robocze ze stanu HEAD](#utwórz-nowe-drzewo-robocze-ze-stanu-head) +* [Przestań śledzić pliki bez usuwania](#przestań-śledzić-pliki-bez-usuwania) +* [Przed usunięciem nieśledzonych plików / katalogu, wykonaj próbę, aby uzyskać listę tych plików / katalogów](#przed-usunięciem-nieśledzonych-plików-katalogu-wykonaj-próbę-aby-uzyskać-listę-tych-plików-katalogów) +* [Wymuś usunięcie nieśledzonych plików](#wymuś-usunięcie-nieśledzonych-plików) +* [Wymuś usunięcie nieśledzonego katalogu](#wymuś-usunięcie-nieśledzonego-katalogu) +* [Zaktualizuj wszystkie submoduły](#zaktualizuj-wszystkie-submoduły) +* [Pokaż wszystkie zatwierdzenia w bieżącym branchu, które mają zostać zmergowane do mastera](#pokaż-wszystkie-zatwierdzenia-w-bieżącym-branchu-które-mają-zostać-zmergowane-do-mastera) +* [Zmień nazwę brancha](#zmień-nazwę-brancha) +* [Rebase 'feature' do 'master' i merguj to do master ](#rebase-feature-do-master-i-merguj-to-do-master) +* [Zarchiwizuj branch `master`](#zarchiwizuj-branch-master) +* [Zmodyfikuj poprzednie zatwierdzenie bez modyfikowania komunikatu zatwierdzenia](#zmodyfikuj-poprzednie-zatwierdzenie-bez-modyfikowania-komunikatu-zatwierdzenia) +* [Czyści odniesienia do zdalnych gałęzi, które zostały usunięte na zdalnym.](#czyści-odniesienia-do-zdalnych-gałęzi-które-zostały-usunięte-na-zdalnym) +* [Pobierz skrót zatwierdzenia z początkowej wersji.](#pobierz-skrót-zatwierdzenia-z-początkowej-wersji) +* [Wizualizuj drzewo wersji.](#wizualizuj-drzewo-wersji) +* [Wizualizuj drzewo, w tym zatwierdzenia, do których odwołuje się tylko dziennik rejestrów](#wizualizuj-drzewo-w-tym-zatwierdzenia-do-których-odwołuje-się-tylko-dziennik-rejestrów) +* [Wdrażanie podfolderu śledzonego przez git do gh-pages](#wdrażanie-podfolderu-śledzonego-przez-git-do-gh-pages) +* [Dodanie projektu do repozytorium za pomocą poddrzewa](#dodanie-projektu-do-repozytorium-za-pomocą-poddrzewa) +* [Pobierz najnowsze zmiany w repozytorium dla połączonego projektu za pomocą poddrzewa](#pobierz-najnowsze-zmiany-w-repozytorium-dla-połączonego-projektu-za-pomocą-poddrzewa) +* [Wyeksportuj gałąź z historią do pliku.](#wyeksportuj-gałąź-z-historią-do-pliku) +* [Importuj z pakietu](#importuj-z-pakietu) +* [Uzyskaj nazwę bieżącego brancha.](#uzyskaj-nazwę-bieżącego-brancha) +* [Zignoruj jeden plik przy zatwierdzaniu (np. Changelog).](#zignoruj-jeden-plik-przy-zatwierdzaniu-np-changelog) +* [Stashuj zmiany przed rebasing'iem](#stashuj-zmiany-przed-rebasingiem) +* [Pobierz pull request według identyfikatora do lokalnego brancha](#pobierz-pull-request-według-identyfikatora-do-lokalnego-brancha) +* [Pokaż najnowszy tag w bieżącym branchu.](#pokaż-najnowszy-tag-w-bieżącym-branchu) +* [Pokaż inline word diff.](#pokaż-inline-word-diff) +* [Pokaż zmiany używając narzędzi common diff.](#pokaż-zmiany-używając-narzędzi-common-diff) +* [Nie rozważaj zmian w śledzonym pliku.](#nie-rozważaj-zmian-w-śledzonym-pliku) +* [Cofnij assume-unchanged.](#cofnij-assume-unchanged) +* [Wyczyść pliki z `.gitignore`.](#wyczyść-pliki-z-gitignore) +* [Przywróć usunięty plik.](#przywróć-usunięty-plik) +* [Przywróć plik do określonego commit-hash](#przywróć-plik-do-określonego-commit-hash) +* [Zawsze rebase zamiast merge na pull.](#zawsze-rebase-zamiast-merge-na-pull) +* [Wyświetl wszystkie aliasy i konfiguracje.](#wyświetl-wszystkie-aliasy-i-konfiguracje) +* [Uwzględnij wielkość liter w git.](#uwzględnij-wielkość-liter-w-git) +* [Dodaj niestandardowe edytory.](#dodaj-niestandardowe-edytory) +* [Automatyczne poprawianie literówek.](#automatyczne-poprawianie-literówek) +* [Sprawdź, czy zmiana była częścią wydania.](#sprawdź-czy-zmiana-była-częścią-wydania) +* [Dry run. (dowolne polecenie obsługujące flagę dry-run powinno zrobić.)](#dry-run-dowolne-polecenie-obsługujące-flagę-dry-run-powinno-zrobić) +* [Oznacza twoje zatwierdzenie jako poprawkę poprzedniego zatwierdzenia.](#oznacza-twoje-zatwierdzenie-jako-poprawkę-poprzedniego-zatwierdzenia) * [Squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) -* [Skip staging area during commit.](#skip-staging-area-during-commit) -* [Interactive staging.](#interactive-staging) -* [List ignored files.](#list-ignored-files) -* [Status of ignored files.](#status-of-ignored-files) -* [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) -* [List n last commits](#list-n-last-commits) -* [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) -* [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) -* [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) -* [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database) -* [Instantly browse your working repository in gitweb.](#instantly-browse-your-working-repository-in-gitweb) -* [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log) -* [Remove entry in the global config.](#remove-entry-in-the-global-config) -* [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history) -* [Extract file from another branch.](#extract-file-from-another-branch) -* [List only the root and merge commits.](#list-only-the-root-and-merge-commits) -* [Change previous two commits with an interactive rebase.](#change-previous-two-commits-with-an-interactive-rebase) -* [List all branch is WIP](#list-all-branch-is-wip) -* [Find guilty with binary search](#find-guilty-with-binary-search) +* [Pomiń staging area podczas commitowania.](#pomiń-staging-area-podczas-commitowania) +* [Interaktywny staging.](#interaktywny-staging) +* [Lista ignorowanych plików.](#lista-ignorowanych-plików) +* [Status zignorowanych plików.](#status-zignorowanych-plików) +* [Commity w Branch1 które nie są w Branch2](#commity-w-Branch1-które-nie-są-w-Branch2) +* [Wyświetl listę n ostatnich commitów](#wyświetl-listę-n-ostatnich-commitów) +* [Ponownie użyj recorded resolution, record and reuse previous conflicts resolutions.](#ponownie-użyj-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) +* [Otwórz wszystkie skonfliktowane pliki w edytorze.](#otwórz-wszystkie-skonfliktowane-pliki-w-edytorze) +* [Policz wypakowaną liczbę obiektów i ich zużycie dysku.](#policz-wypakowaną-liczbę-obiektów-i-ich-zużycie-dysku) +* [Wyczyść wszystkie nieosiągalne obiekty z bazy danych obiektów.](#wyczyść-wszystkie-nieosiągalne-obiekty-z-bazy-danych-obiektów) +* [Natychmiast przeglądaj działające repozytorium w gitweb.](#natychmiast-przeglądaj-działające-repozytorium-w-gitweb) +* [Wyświetl podpisy GPG w dzienniku zatwierdzeń](#wyświetl-podpisy-gpg-w-dzienniku-zatwierdzeń) +* [Usuń wpis w globalnej konfiguracji.](#usuń-wpis-w-globalnej-konfiguracji) +* [Checkout nowego brancha bez historii](#checkout-nowego-brancha-bez-historii) +* [Wyodrębnij plik z innej gałęzi.](#wyodrębnij-plik-z-innej-gałęzi) +* [Wymień tylko root i merge commits.](#wymień-tylko-root-i-merge-commits) +* [Zmień poprzednie dwa zatwierdzenia za pomocą interaktywnego rebase.](#zmień-poprzednie-dwa-zatwierdzenia-za-pomocą-interaktywnego-rebase) +* [Wymień wszystkie gałęzie, których praca jest w toku (WIP)](#wymień-wszystkie-gałęzie-których-praca-jest-w-toku-wip) +* [Znajdź nieczyste korzystając z wyszukiwania binarnego](#znajdź-nieczyste-korzystając-z-wyszukiwania-binarnego) * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) -* [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) -* [Clone a single branch](#clone-a-single-branch) -* [Create and switch new branch](#create-and-switch-new-branch) -* [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) -* [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) -* [Specific color settings](#specific-color-settings) -* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) -* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) -* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) -* [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) -* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) +* [Lista zatwierdzeń i zmian w określonym pliku (nawet poprzez zmianę nazwy)](#lista-zatwierdzeń-i-zmian-w-określonym-pliku-nawet-poprzez-zmianę-nazwy) +* [Klonuj pojedynczy branch](#klonuj-pojedynczy-branch) +* [Utwórz i zmień nowy branch](#utwórz-i-zmień-nowy-branch) +* [Ignoruj tryb zmiany plików na commitach](#ignoruj-tryb-zmiany-plików-na-commitach) +* [Wyłącz git colored terminal output](#wyłącz-git-colored-terminal-output) +* [Określone ustawienia kolorów](#określone-ustawienia-kolorów) +* [Pokaż wszystkie lokalne branche uporządkowane według ostatnich commitów](#pokaż-wszystkie-lokalne-branche-uporządkowane-według-ostatnich-commitów) +* [Znajdź wiersze pasujące do wzorca (wyrażenia regularnego lub ciągu) w śledzonych plikach](#znajdź-wiersze-pasujące-do-wzorca-wyrażenia-regularnego-lub-ciągu-w-śledzonych-plikach) +* [Sklonuj płytką kopię repozytorium](#sklonuj-płytką-kopię-repozytorium) +* [Wyszukaj Commit log we wszystkich branchach dla podanego tekstu](#wyszukaj-commit-log-we-wszystkich-branchach-dla-podanego-tekstu) +* [Uzyskaj pierwszy commit w branchu (z master)](#uzyskaj-pierwszy-commit-w-branchu-z-master) * [Unstaging Staged file](#unstaging-staged-file) -* [Force push to Remote Repository](#force-push-to-remote-repository) -* [Adding Remote name](#adding-remote-name) -* [List all currently configured remotes](#list-all-currently-configured-remotes) -* [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) -* [Group commits by authors and title](#group-commits-by-authors-and-title) -* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) -* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) -* [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge) -* [Number of commits in a branch](#number-of-commits-in-a-branch) -* [Alias: git undo](#alias-git-undo) -* [Add object notes](#add-object-notes) -* [Show all the git-notes](#show-all-the-git-notes) -* [Apply commit from another repository](#apply-commit-from-another-repository) +* [Wymuś wypchnięcie do zdalnego repozytorium](#wymuś-wypchnięcie-do-zdalnego-repozytorium) +* [Dodawanie nazwy zdalnej](#dodawanie-nazwy-zdalnej) +* [Wyświetl listę wszystkich aktualnie skonfigurowanych zdalnych](#wyświetl-listę-wszystkich-aktualnie-skonfigurowanych-zdalnych) +* [Pokaż autora, czas i ostatnią wersję dokonaną w każdej linii danego pliku](#pokaż-autora-czas-i-ostatnią-wersję-dokonaną-w-każdej-linii-danego-pliku) +* [Grupuj commity według autorów i tytułów](#grupuj-commity-według-autorów-i-tytułów) +* [Wymuś pusha, ale nadal upewnij się, że nie nadpisujesz pracy innych](#wymuś-pusha-ale-nadal-upewnij-się-że-nie-nadpisujesz-pracy-innych) +* [Pokaż, ile wierszy ma współautor](#pokaż-ile-wierszy-ma-współautor) +* [Cofnij: Cofnięcie całego merge](#cofnij-cofnięcie-całego-merge) +* [Liczba commitów w branchu](#liczba-commitów-w-branchu) +* [Alias: git undo - cofnij](#alias-git-undo-cofnij) +* [Dodaj notatkę obiektu](#dodaj-notatkę-obiektu) +* [Pokaż wszystkie git-notes](#pokaż-wszystkie-git-notes) +* [Zastosuj commit z innego repozytorium](#zastosuj-commit-z-innego-repozytorium) * [Specific fetch reference](#specific-fetch-reference) -* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) -* [List unpushed git commits](#list-unpushed-git-commits) -* [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) -* [Edit [local/global] git config](#edit-localglobal-git-config) -* [blame on certain range](#blame-on-certain-range) -* [Show a Git logical variable.](#show-a-git-logical-variable) +* [Znajdź wspólnego przodka dwóch gałęzi](#znajdź-wspólnego-przodka-dwóch-gałęzi) +* [Wyświetl unpushed git commits](#wyświetl-unpushed-git-commits) +* [Dodaj wszystko, ale bez zmiany białych znaków](#dodaj-wszystko-ale-bez-zmiany-białych-znaków) +* [Edytuj [local/global] git config](#edytuj-local-global-git-config) +* [Blame on certain range](#blame-on-certain-range) +* [Pokaż zmienną logiczną Git.](#pokaż-zmienną-logiczną-git) * [Preformatted patch file.](#preformatted-patch-file) -* [Get the repo name.](#get-the-repo-name) -* [logs between date range](#logs-between-date-range) -* [Exclude author from logs](#exclude-author-from-logs) -* [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) -* [List references in a remote repository](#list-references-in-a-remote-repository) -* [Backup untracked files.](#backup-untracked-files) -* [List all git aliases](#list-all-git-aliases) -* [Show git status short](#show-git-status-short) -* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) -* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) -* [Change a branch base](#change-a-branch-base) -* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) -* [Update a submodule to the latest commit](#update-a-submodule-to-the-latest-commit) -* [Prevent auto replacing LF with CRLF](#prevent-auto-replacing-lf-with-crlf) +* [Uzyskaj nazwę repozytorium.](#uzyskaj-nazwę-repozytorium) +* [Logi między zakresem dat](#logi-między-zakresem-dat) +* [Wyklucz autora z logów](#wyklucz-autora-z-logów) +* [Generuj podsumowanie oczekujących zmian](#generuj-podsumowanie-oczekujących-zmian) +* [Lista referencji w zdalnym repozytorium](#lista-referencji-w-zdalnym-repozytorium) +* [Utwórz kopię zapasową nieśledzonych plików.](#utwórz-kopię-zapasową-nieśledzonych-plików) +* [Wyświetl wszystkie aliasy git](#wyświetl-wszystkie-aliasy-git) +* [Pokaż git status short](#pokaż-git-status-short) +* [Sprawdź commit sprzed dnia](#sprawdź-commit-sprzed-dnia) +* [Popchnij nowy branch lokalny do zdalnego repozytorium i śledź](#popchnij-nowy-branch-lokalny-do-zdalnego-repozytorium-i-śledź) +* [Zmień branch base](#zmień-branch-base) +* [Użyj SSH zamiast HTTPs dla remotes](#użyj-ssh-zamiast-https-dla-remotes) +* [Zaktualizuj submoduł do najnowszego commita](#zaktualizuj-submoduł-do-najnowszego-commita) +* [Zapobiegaj automatycznemu zastępowaniu LF przez CRLF](#zapobiegaj-automatycznemu-zastępowaniu-lf-przez-crlf) @@ -181,131 +181,131 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. -## Everyday Git in twenty commands or so +## Codziennie Git w około dwudziestu poleceniach ```sh git help everyday ``` -## Show helpful guides that come with Git +## Pokaż przydatne przewodniki dla Git ```sh git help -g ``` -## Search change by content +## Wyszukaj zmianę według zawartości ```sh git log -S'' ``` -## Show changes over time for specific file +## Pokaż zmiany w czasie dla określonego pliku ```sh git log -p ``` -## Remove sensitive data from history, after a push +## Usuń wrażliwe dane z historii po push ```sh git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all ``` -## Sync with remote, overwrite local changes +## Synchronizuj ze zdalnym, zastępuj lokalne zmiany ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` -## List of all files till a commit +## Lista wszystkich plików do commita ```sh git ls-tree --name-only -r ``` -## Git reset first commit +## Git zresetuj pierwszy commit ```sh git update-ref -d HEAD ``` -## Reset: preserve uncommitted local changes +## Reset: zachowaj niezatwierdzone zmiany lokalne ```sh git reset --keep ``` -## List all the conflicted files +## Wyświetl wszystkie skonfliktowane pliki ```sh git diff --name-only --diff-filter=U ``` -## List of all files changed in a commit +## Lista wszystkich plików zmienionych w commitcie ```sh git diff-tree --no-commit-id --name-only -r ``` -## Unstaged changes since last commit +## Zmienione ale niezaktualizowane zmiany od ostatniego zatwierdzenia ```sh git diff ``` -## Changes staged for commit +## Porównanie zmian z poczekalni z ostatnią zmianą ```sh git diff --cached ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git diff --staged ``` -## Show both staged and unstaged changes +## Pokaż wszystkie zmiany w śledzonych plikach. ```sh git diff HEAD ``` -## List all branches that are already merged into master +## Lista wszystkich gałęzi, które są już zmergowane do mastera ```sh git branch --merged master ``` -## Quickly switch to the previous branch +## Szybko przełącz na poprzednią gałąź ```sh git checkout - ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git checkout @{-1} ``` -## Remove branches that have already been merged with master +## Usuń gałęzie które zostały już połączone z master ```sh git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out ``` -## List all branches and their upstreams, as well as last commit on branch +## Wymień wszystkie gałęzie i ich wyższe poziomy, a także ostatnie zatwierdzenie na gałęzi ```sh git branch -vv ``` -## Track upstream branch +## Śledź odgałęzienie ```sh git branch -u origin/mybranch ``` -## Delete local branch +## Usuń lokalną gałąź ```sh git branch -d ``` -## Delete remote branch +## Usuń zdalną gałąź ```sh git push origin --delete ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git push origin : ``` @@ -315,143 +315,143 @@ git push origin : git branch -dr ``` -## Delete local tag +## Usuń lokalny tag ```sh git tag -d ``` -## Delete remote tag +## Usuń zdalny tag ```sh git push origin :refs/tags/ ``` -## Undo local changes with the last content in head +## Cofnij zmiany lokalne z ostatnią zawartością w head ```sh git checkout -- ``` -## Revert: Undo a commit by creating a new commit +## Cofnij: Cofnij commita, tworząc nowego commita ```sh git revert ``` -## Reset: Discard commits, advised for private branch +## Reset: Odrzuć commity, zalecane dla prywatnej gałęzi ```sh git reset ``` -## Reword the previous commit message +## Zmień kolejność poprzedniej wiadomości commita ```sh git commit -v --amend ``` -## See commit history for just the current branch +## Zobacz historię zatwierdzeń tylko dla bieżącej gałęzi ```sh git cherry -v master ``` -## Amend author. +## Zmień autora. ```sh git commit --amend --author='Author Name ' ``` -## Reset author, after author has been changed in the global config. +## Resetuj autora po zmianie autora w global config. ```sh git commit --amend --reset-author --no-edit ``` -## Changing a remote's URL +## Zmiana zdalnego adresu URL ```sh git remote set-url origin ``` -## Get list of all remote references +## Uzyskaj listę wszystkich zdalnych referencji ```sh git remote ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git remote show ``` -## Get list of all local and remote branches +## Uzyskaj listę wszystkich lokalnych i zdalnych gałęzi ```sh git branch -a ``` -## Get only remote branches +## Uzyskaj tylko zdalne gałęzie ```sh git branch -r ``` -## Stage parts of a changed file, instead of the entire file +## Śledź części zmienionego pliku zamiast całego pliku ```sh git add -p ``` -## Get git bash completion +## Uzyskaj ukończenie git bash ```sh curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` -## What changed since two weeks? +## Co zmieniło się od dwóch tygodni? ```sh git log --no-merges --raw --since='2 weeks ago' ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git whatchanged --since='2 weeks ago' ``` -## See all commits made since forking from master +## Zobacz wszystkie zatwierdzenia dokonane od czasu forkowania z mastera ```sh git log --no-merges --stat --reverse master.. ``` -## Pick commits across branches using cherry-pick +## Wybierz zatwierdzenia między gałęziami za pomocą cherry-pick ```sh git checkout && git cherry-pick ``` -## Find out branches containing commit-hash +## Znajdź gałęzie zawierające commit-hash ```sh git branch -a --contains ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git branch --contains ``` -## Git Aliases +## Aliasy Gita ```sh git config --global alias. git config --global alias.st status ``` -## Saving current state of tracked files without commiting +## Zapisywanie bieżącego stanu śledzonych plików bez zatwierdzania ```sh git stash ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash save ``` -## Saving current state of unstaged changes to tracked files +## Zapisywanie aktualnego stanu zmian unstaged do śledzonych plików ```sh git stash -k ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash --keep-index ``` @@ -461,13 +461,13 @@ git stash --keep-index git stash save --keep-index ``` -## Saving current state including untracked files +## Zapisywanie bieżącego stanu, w tym nieśledzonych plików ```sh git stash -u ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash save -u ``` @@ -477,18 +477,18 @@ git stash save -u git stash save --include-untracked ``` -## Saving current state with message +## Zapisywanie aktualnego stanu z komunikatem ```sh git stash save ``` -## Saving current state of all files (ignored, untracked, and tracked) +## Zapisywanie bieżącego stanu wszystkich plików (ignorowanych, nieśledzonych i śledzonych) ```sh git stash -a ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash --all ``` @@ -498,107 +498,107 @@ git stash --all git stash save --all ``` -## Show list of all saved stashes +## Pokaż listę wszystkich zapisanych stashes ```sh git stash list ``` -## Apply any stash without deleting from the stashed list +## Zastosuj dowolony stash bez usuwania z listy stashed ```sh git stash apply ``` -## Apply last stashed state and delete it from stashed list +## Zastosuj ostatni stan stashed i usuń go z listy stashed ```sh git stash pop ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash apply stash@{0} && git stash drop stash@{0} ``` -## Delete all stored stashes +## Usuń wszystkie przechowywane stashes ```sh git stash clear ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git stash drop ``` -## Grab a single file from a stash +## Weź pojedynczy plik z pliku stash ```sh git checkout -- ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git checkout stash@{0} -- ``` -## Show all tracked files +## Pokaż wszystkie śledzone pliki ```sh git ls-files -t ``` -## Show all untracked files +## Pokaż wszystkie nieśledzone pliki ```sh git ls-files --others ``` -## Show all ignored files +## Pokaż wszystkie zignorowane pliki ```sh git ls-files --others -i --exclude-standard ``` -## Create new working tree from a repository (git 2.5) +## Utwórz nowe drzewo robocze z repozytorium (git 2.5) ```sh git worktree add -b ``` -## Create new working tree from HEAD state +## Utwórz nowe drzewo robocze ze stanu HEAD ```sh git worktree add --detach HEAD ``` -## Untrack files without deleting +## Przestań śledzić pliki bez usuwania ```sh git rm --cached ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git rm --cached -r ``` -## Before deleting untracked files/directory, do a dry run to get the list of these files/directories +## Przed usunięciem nieśledzonych plików / katalogu, wykonaj próbę, aby uzyskać listę tych plików / katalogów ```sh git clean -n ``` -## Forcefully remove untracked files +## Wymuś usunięcie nieśledzonych plików ```sh git clean -f ``` -## Forcefully remove untracked directory +## Wymuś usunięcie nieśledzonego katalogu ```sh git clean -f -d ``` -## Update all the submodules +## Zaktualizuj wszystkie submoduły ```sh git submodule foreach git pull ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git submodule update --init --recursive ``` @@ -608,61 +608,61 @@ git submodule update --init --recursive git submodule update --remote ``` -## Show all commits in the current branch yet to be merged to master +## Pokaż wszystkie zatwierdzenia w bieżącym branchu, które mają zostać zmergowane do mastera ```sh git cherry -v master ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git cherry -v master ``` -## Rename a branch +## Zmień nazwę brancha ```sh git branch -m ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git branch -m [] ``` -## Rebases 'feature' to 'master' and merges it in to master +## Rebase 'feature' do 'master' i merguj to do master ```sh git rebase master feature && git checkout master && git merge - ``` -## Archive the `master` branch +## Zarchiwizuj branch `master` ```sh git archive master --format=zip --output=master.zip ``` -## Modify previous commit without modifying the commit message +## Zmodyfikuj poprzednie zatwierdzenie bez modyfikowania komunikatu zatwierdzenia ```sh git add --all && git commit --amend --no-edit ``` -## Prunes references to remote branches that have been deleted in the remote. +## Czyści odniesienia do zdalnych gałęzi, które zostały usunięte na zdalnym. ```sh git fetch -p ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git remote prune origin ``` -## Retrieve the commit hash of the initial revision. +## Pobierz skrót zatwierdzenia z początkowej wersji. ```sh git rev-list --reverse HEAD | head -1 ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git rev-list --max-parents=0 HEAD ``` @@ -677,13 +677,13 @@ git log --pretty=oneline | tail -1 | cut -c 1-40 git log --pretty=oneline --reverse | head -1 | cut -c 1-40 ``` -## Visualize the version tree. +## Wizualizuj drzewo wersji. ```sh git log --pretty=oneline --graph --decorate --all ``` -__Alternatives:__ +__Alternatywnie:__ ```sh gitk --all ``` @@ -693,145 +693,145 @@ gitk --all git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d' ``` -## Visualize the tree including commits that are only referenced from reflogs +## Wizualizuj drzewo, w tym zatwierdzenia, do których odwołuje się tylko dziennik rejestrów ```sh git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all) ``` -## Deploying git tracked subfolder to gh-pages +## Wdrażanie podfolderu śledzonego przez git do gh-pages ```sh git subtree push --prefix subfolder_name origin gh-pages ``` -## Adding a project to repo using subtree +## Dodanie projektu do repozytorium za pomocą poddrzewa ```sh git subtree add --prefix=/ --squash git@github.com:/.git master ``` -## Get latest changes in your repo for a linked project using subtree +## Pobierz najnowsze zmiany w repozytorium dla połączonego projektu za pomocą poddrzewa ```sh git subtree pull --prefix=/ --squash git@github.com:/.git master ``` -## Export a branch with history to a file. +## Wyeksportuj gałąź z historią do pliku. ```sh git bundle create ``` -## Import from a bundle +## Importuj z pakietu ```sh git clone repo.bundle -b ``` -## Get the name of current branch. +## Uzyskaj nazwę bieżącego brancha. ```sh git rev-parse --abbrev-ref HEAD ``` -## Ignore one file on commit (e.g. Changelog). +## Zignoruj jeden plik przy zatwierdzaniu (np. Changelog). ```sh git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog ``` -## Stash changes before rebasing +## Stashuj zmiany przed rebasing'iem ```sh git rebase --autostash ``` -## Fetch pull request by ID to a local branch +## Pobierz pull request według identyfikatora do lokalnego brancha ```sh git fetch origin pull//head: ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git pull origin pull//head: ``` -## Show the most recent tag on the current branch. +## Pokaż najnowszy tag w bieżącym branchu. ```sh git describe --tags --abbrev=0 ``` -## Show inline word diff. +## Pokaż inline word diff. ```sh git diff --word-diff ``` -## Show changes using common diff tools. +## Pokaż zmiany używając narzędzi common diff. ```sh git difftool [-t ] ``` -## Don’t consider changes for tracked file. +## Nie rozważaj zmian w śledzonym pliku. ```sh git update-index --assume-unchanged ``` -## Undo assume-unchanged. +## Cofnij assume-unchanged. ```sh git update-index --no-assume-unchanged ``` -## Clean the files from `.gitignore`. +## Wyczyść pliki z `.gitignore`. ```sh git clean -X -f ``` -## Restore deleted file. +## Przywróć usunięty plik. ```sh git checkout ^ -- ``` -## Restore file to a specific commit-hash +## Przywróć plik do określonego commit-hash ```sh git checkout -- ``` -## Always rebase instead of merge on pull. +## Zawsze rebase zamiast merge na pull. ```sh git config --global pull.rebase true ``` -__Alternatives:__ +__Alternatywnie:__ ```sh #git < 1.7.9 git config --global branch.autosetuprebase always ``` -## List all the alias and configs. +## Wyświetl wszystkie aliasy i konfiguracje. ```sh git config --list ``` -## Make git case sensitive. +## Uwzględnij wielkość liter w git. ```sh git config --global core.ignorecase false ``` -## Add custom editors. +## Dodaj niestandardowe edytory. ```sh git config --global core.editor '$EDITOR' ``` -## Auto correct typos. +## Automatyczne poprawianie literówek. ```sh git config --global help.autocorrect 1 ``` -## Check if the change was a part of a release. +## Sprawdź, czy zmiana była częścią wydania. ```sh git name-rev --name-only ``` -## Dry run. (any command that supports dry-run flag should do.) +## Dry run. (dowolne polecenie obsługujące flagę dry-run powinno zrobić.) ```sh git clean -fd --dry-run ``` -## Marks your commit as a fix of a previous commit. +## Oznacza twoje zatwierdzenie jako poprawkę poprzedniego zatwierdzenia. ```sh git commit --fixup ``` @@ -841,103 +841,103 @@ git commit --fixup git rebase -i --autosquash ``` -## Skip staging area during commit. +## Pomiń staging area podczas commitowania. ```sh git commit --only ``` -## Interactive staging. +## Interaktywny staging. ```sh git add -i ``` -## List ignored files. +## Lista ignorowanych plików. ```sh git check-ignore * ``` -## Status of ignored files. +## Status zignorowanych plików. ```sh git status --ignored ``` -## Commits in Branch1 that are not in Branch2 +## Commity w Branch1 które nie są w Branch2 ```sh git log Branch1 ^Branch2 ``` -## List n last commits +## Wyświetl listę n ostatnich commitów ```sh git log - ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git log -n ``` -## Reuse recorded resolution, record and reuse previous conflicts resolutions. +## Ponownie użyj recorded resolution, record and reuse previous conflicts resolutions. ```sh git config --global rerere.enabled 1 ``` -## Open all conflicted files in an editor. +## Otwórz wszystkie skonfliktowane pliki w edytorze. ```sh git diff --name-only | uniq | xargs $EDITOR ``` -## Count unpacked number of objects and their disk consumption. +## Policz wypakowaną liczbę obiektów i ich zużycie dysku. ```sh git count-objects --human-readable ``` -## Prune all unreachable objects from the object database. +## Wyczyść wszystkie nieosiągalne obiekty z bazy danych obiektów. ```sh git gc --prune=now --aggressive ``` -## Instantly browse your working repository in gitweb. +## Natychmiast przeglądaj działające repozytorium w gitweb. ```sh git instaweb [--local] [--httpd=] [--port=] [--browser=] ``` -## View the GPG signatures in the commit log +## Wyświetl podpisy GPG w dzienniku zatwierdzeń ```sh git log --show-signature ``` -## Remove entry in the global config. +## Usuń wpis w globalnej konfiguracji. ```sh git config --global --unset ``` -## Checkout a new branch without any history +## Checkout nowego brancha bez historii ```sh git checkout --orphan ``` -## Extract file from another branch. +## Wyodrębnij plik z innej gałęzi. ```sh git show : ``` -## List only the root and merge commits. +## Wymień tylko root i merge commits. ```sh git log --first-parent ``` -## Change previous two commits with an interactive rebase. +## Zmień poprzednie dwa zatwierdzenia za pomocą interaktywnego rebase. ```sh git rebase --interactive HEAD~2 ``` -## List all branch is WIP +## Wymień wszystkie gałęzie, których praca jest w toku (WIP) ```sh git checkout master && git branch --no-merged ``` -## Find guilty with binary search +## Znajdź nieczyste korzystając z wyszukiwania binarnego ```sh git bisect start # Search start git bisect bad # Set point to bad commit @@ -953,69 +953,69 @@ git bisect reset # Finish search git commit --no-verify ``` -## List commits and changes to a specific file (even through renaming) +## Lista zatwierdzeń i zmian w określonym pliku (nawet poprzez zmianę nazwy) ```sh git log --follow -p -- ``` -## Clone a single branch +## Klonuj pojedynczy branch ```sh git clone -b --single-branch https://github.com/user/repo.git ``` -## Create and switch new branch +## Utwórz i zmień nowy branch ```sh git checkout -b ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git branch && git checkout ``` -## Ignore file mode changes on commits +## Ignoruj tryb zmiany plików na commitach ```sh git config core.fileMode false ``` -## Turn off git colored terminal output +## Wyłącz git colored terminal output ```sh git config --global color.ui false ``` -## Specific color settings +## Określone ustawienia kolorów ```sh git config --global ``` -## Show all local branches ordered by recent commits +## Pokaż wszystkie lokalne branche uporządkowane według ostatnich commitów ```sh git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ ``` -## Find lines matching the pattern (regex or string) in tracked files +## Znajdź wiersze pasujące do wzorca (wyrażenia regularnego lub ciągu) w śledzonych plikach ```sh git grep --heading --line-number 'foo bar' ``` -## Clone a shallow copy of a repository +## Sklonuj płytką kopię repozytorium ```sh git clone https://github.com/user/repo.git --depth 1 ``` -## Search Commit log across all branches for given text +## Wyszukaj Commit log we wszystkich branchach dla podanego tekstu ```sh git log --all --grep='' ``` -## Get first commit in a branch (from master) +## Uzyskaj pierwszy commit w branchu (z master) ```sh git log --oneline master.. | tail -1 ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git log --reverse master.. | head -6 ``` @@ -1025,75 +1025,75 @@ git log --reverse master.. | head -6 git reset HEAD ``` -## Force push to Remote Repository +## Wymuś wypchnięcie do zdalnego repozytorium ```sh git push -f ``` -## Adding Remote name +## Dodawanie nazwy zdalnej ```sh git remote add ``` -## List all currently configured remotes +## Wyświetl listę wszystkich aktualnie skonfigurowanych zdalnych ```sh git remote -v ``` -## Show the author, time and last revision made to each line of a given file +## Pokaż autora, czas i ostatnią wersję dokonaną w każdej linii danego pliku ```sh git blame ``` -## Group commits by authors and title +## Grupuj commity według autorów i tytułów ```sh git shortlog ``` -## Forced push but still ensure you don't overwrite other's work +## Wymuś pusha, ale nadal upewnij się, że nie nadpisujesz pracy innych ```sh git push --force-with-lease ``` -## Show how many lines does an author contribute +## Pokaż, ile wierszy ma współautor ```sh git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += ; subs += ; loc += - } END { printf "added lines: %s removed lines: %s total lines: %s ", add, subs, loc }' - ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += ; subs += ; loc += - } END { printf "added lines: %s, removed lines: %s, total lines: %s ", add, subs, loc }' - # on Mac OSX ``` -## Revert: Reverting an entire merge +## Cofnij: Cofnięcie całego merge ```sh git revert -m 1 ``` -## Number of commits in a branch +## Liczba commitów w branchu ```sh git rev-list --count ``` -## Alias: git undo +## Alias: git undo - cofnij ```sh git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' ``` -## Add object notes +## Dodaj notatkę obiektu ```sh git notes add -m 'Note on the previous commit....' ``` -## Show all the git-notes +## Pokaż wszystkie git-notes ```sh git log --show-notes='*' ``` -## Apply commit from another repository +## Zastosuj commit z innego repozytorium ```sh git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k ``` @@ -1103,18 +1103,18 @@ git --git-dir=/.git format-patch -k -1 --stdout | git am -3 - git fetch origin master:refs/remotes/origin/mymaster ``` -## Find common ancestor of two branches +## Znajdź wspólnego przodka dwóch gałęzi ```sh git merge-base ``` -## List unpushed git commits +## Wyświetl unpushed git commits ```sh git log --branches --not --remotes ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git log @{u}.. ``` @@ -1124,12 +1124,12 @@ git log @{u}.. git cherry -v ``` -## Add everything, but whitespace changes +## Dodaj wszystko, ale bez zmiany białych znaków ```sh git diff --ignore-all-space | git apply --cached ``` -## Edit [local/global] git config +## Edytuj [local/global] git config ```sh git config [--global] --edit ``` @@ -1139,7 +1139,7 @@ git config [--global] --edit git blame -L , ``` -## Show a Git logical variable. +## Pokaż zmienną logiczną Git. ```sh git var -l | ``` @@ -1149,74 +1149,74 @@ git var -l | git format-patch -M upstream..topic ``` -## Get the repo name. +## Uzyskaj nazwę repozytorium. ```sh git rev-parse --show-toplevel ``` -## logs between date range +## logi między zakresem dat ```sh git log --since='FEB 1 2017' --until='FEB 14 2017' ``` -## Exclude author from logs +## Wyklucz autora z logów ```sh git log --perl-regexp --author='^((?!excluded-author-regex).*) ``` -## Generates a summary of pending changes +## Generuj podsumowanie oczekujących zmian ```sh git request-pull v1.0 https://git.ko.xz/project master:for-linus ``` -## List references in a remote repository +## Lista referencji w zdalnym repozytorium ```sh git ls-remote git://git.kernel.org/pub/scm/git/git.git ``` -## Backup untracked files. +## Utwórz kopię zapasową nieśledzonych plików. ```sh git ls-files --others -i --exclude-standard | xargs zip untracked.zip ``` -## List all git aliases +## Wyświetl wszystkie aliasy git ```sh git config -l | grep alias | sed 's/^alias\.//g' ``` -__Alternatives:__ +__Alternatywnie:__ ```sh git config -l | grep alias | cut -d '.' -f 2 ``` -## Show git status short +## Pokaż git status short ```sh git status --short --branch ``` -## Checkout a commit prior to a day ago +## Sprawdź commit sprzed dnia ```sh git checkout master@{yesterday} ``` -## Push a new local branch to remote repository and track +## Popchnij nowy branch lokalny do zdalnego repozytorium i śledź ```sh git push -u origin ``` -## Change a branch base +## Zmień branch base ```sh git rebase --onto ``` -## Use SSH instead of HTTPs for remotes +## Użyj SSH zamiast HTTPs dla remotes ```sh git config --global url.'git@github.com:'.insteadOf 'https://github.com/' ``` -## Update a submodule to the latest commit +## Zaktualizuj submoduł do najnowszego commita ```sh cd git pull origin @@ -1225,7 +1225,7 @@ git add git commit -m "submodule updated" ``` -## Prevent auto replacing LF with CRLF +## Zapobiegaj automatycznemu zastępowaniu LF przez CRLF ```sh git config --global core.autocrlf false ``` From daf32cf5add029f653cbebf1ea7754434c859d17 Mon Sep 17 00:00:00 2001 From: "hemanth.hm" Date: Tue, 28 Apr 2020 12:48:35 -0700 Subject: [PATCH 234/251] Revert "[WIP] Polish version (#180)" This reverts commit 512ec7764c194d61e06e4f411a2e04ecfd06c92a. --- README.md | 698 +++++++++++++++++++++++++++--------------------------- 1 file changed, 349 insertions(+), 349 deletions(-) diff --git a/README.md b/README.md index 7ff3c8b..0e69629 100644 --- a/README.md +++ b/README.md @@ -1,179 +1,179 @@ ## git-tips -> Kolekcja`git-tips`, chcesz dodać swoje wskazówki? Sprawdź [contributing.md](./contributing.md) +> Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) | [Polski](https://github.com/mbiesiad/tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) -### __Narzędzia:__ +### __Tools:__ -* [git-tip](https://www.npmjs.com/package/git-tip) - Poręczny interfejs CLI umożliwiający optymalne wykorzystanie tych wskazówek. ([Tutaj jest kontener Docker](https://github.com/djoudi5/docker-git-tip)) +* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. ([Here in Docker container](https://github.com/djoudi5/docker-git-tip)) -P.S: Wszystkie te polecenia są testowane na `git version 2.7.4 (Apple Git-66)`. +P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. -* [Codziennie Git w około dwudziestu poleceniach](#codziennie-git-w-około-dwudziestu-poleceniach) -* [Pokaż przydatne przewodniki dla Git](#pokaż-przydatne-przewodniki-dla-git) -* [Wyszukaj zmianę według zawartości](#wyszukaj-zmianę-według-zawartości) -* [Pokaż zmiany w czasie dla określonego pliku](#pokaż-zmiany-w-czasie-dla-określonego-pliku) -* [Usuń wrażliwe dane z historii po push](#usuń-wrażliwe-dane-z-historii-po-push) -* [Synchronizuj ze zdalnym, zastępuj lokalne zmiany](#synchronizuj-ze-zdalnym-zastępuj-lokalne-zmiany) -* [Lista wszystkich plików do commita](#lista-wszystkich-plików-do-commita) -* [Git zresetuj pierwszy commit](#git-zresetuj-pierwszy-commit) -* [Reset: zachowaj niezatwierdzone zmiany lokalne](#reset-zachowaj-niezatwierdzone-zmiany-lokalne) -* [Wyświetl wszystkie skonfliktowane pliki](#wyświetl-wszystkie-skonfliktowane-pliki) -* [Lista wszystkich plików zmienionych w commitcie](#lista-wszystkich-plików-zmienionych-w-commitcie) -* [Zmienione ale niezaktualizowane zmiany od ostatniego zatwierdzenia](#zmienione-ale-niezaktualizowane-zmiany-od-ostatniego-zatwierdzenia) -* [Porównanie zmian z poczekalni z ostatnią zmianą](#porównanie-zmian-z-poczekalni-z-ostatnią-zmianą) -* [Pokaż wszystkie zmiany w śledzonych plikach.](#pokaż-wszystkie-zmiany-w-śledzonych-plikach) -* [Lista wszystkich gałęzi, które są już zmergowane do mastera](#lista-wszystkich-gałęzi-które-są-już-zmergowane-do-mastera) -* [Szybko przełącz na poprzednią gałąź](#szybko-przełącz-na-poprzednią-gałąź) -* [Usuń gałęzie które zostały już połączone z master](#usuń-gałęzie-które-zostały-już-połączone-z-master) -* [Wymień wszystkie gałęzie i ich wyższe poziomy, a także ostatnie zatwierdzenie na gałęzi](#wymień-wszystkie-gałęzie-i-ich-wyższe-poziomy-a-także-ostatnie-zatwierdzenie-na-gałęzi) -* [Śledź odgałęzienie](#śledź-odgałęzienie) -* [Usuń lokalną gałąź](#usuń-lokalną-gałąź) -* [Usuń zdalną gałąź](#usuń-zdalną-gałąź) -* [Usuń lokalny tag](#usuń-lokalny-tag) -* [Usuń zdalny tag](#usuń-zdalny-tag) -* [Cofnij zmiany lokalne z ostatnią zawartością w head](#cofnij-zmiany-lokalne-z-ostatnią-zawartością-w-head) -* [Cofnij: Cofnij commita, tworząc nowego commita](#cofnij-cofnij-commita-tworząc-nowego-commita) -* [Reset: Odrzuć commity, zalecane dla prywatnej gałęzi](#reset-odrzuć-commity-zalecane-dla-prywatnej-gałęzi) -* [Zmień kolejność poprzedniej wiadomości commita](#zmień-kolejność-poprzedniej-wiadomości-commita) -* [Zobacz historię zatwierdzeń tylko dla bieżącej gałęzi](#zobacz-historię-zatwierdzeń-tylko-dla-bieżącej-gałęzi) -* [Zmień autora.](#zmień-autora) -* [Resetuj autora po zmianie autora w global config.](#resetuj-autora-po-zmianie-autora-w-global-config) -* [Zmiana zdalnego adresu URL](#zmiana-zdalnego-adresu-URL) -* [Uzyskaj listę wszystkich zdalnych referencji](#uzyskaj-listę-wszystkich-zdalnych-referencji) -* [Uzyskaj listę wszystkich lokalnych i zdalnych gałęzi](#uzyskaj-listę-wszystkich-lokalnych-i-zdalnych-gałęzi) -* [Uzyskaj tylko zdalne gałęzie](#uzyskaj-tylko-zdalne-gałęzie) -* [Śledź części zmienionego pliku zamiast całego pliku](#śledź-części-zmienionego-pliku-zamiast-całego-pliku) -* [Uzyskaj ukończenie git bash](#uzyskaj-ukończenie-git-bash) -* [Co zmieniło się od dwóch tygodni?](#co-zmieniło-się-od-dwóch-tygodni) -* [Zobacz wszystkie zatwierdzenia dokonane od czasu forkowania z mastera](#zobacz-wszystkie-zatwierdzenia-dokonane-od-czasu-forkowania-z-mastera) -* [Wybierz zatwierdzenia między gałęziami za pomocą cherry-pick](#wybierz-zatwierdzenia-między-gałęziami-za-pomocą-cherry-pick) -* [Znajdź gałęzie zawierające commit-hash](#znajdź-gałęzie-zawierające-commit-hash) -* [Aliasy Gita](#aliasy-gita) -* [Zapisywanie bieżącego stanu śledzonych plików bez zatwierdzania](#zapisywanie-bieżącego-stanu-śledzonych-plików-bez-zatwierdzania) -* [Zapisywanie aktualnego stanu zmian unstaged do śledzonych plików](#zapisywanie-aktualnego-stanu-zmian-unstaged-do-śledzonych-plików) -* [Zapisywanie bieżącego stanu, w tym nieśledzonych plików](#zapisywanie-bieżącego-stanu-w-tym-nieśledzonych-plików) -* [Zapisywanie aktualnego stanu z komunikatem](#zapisywanie-aktualnego-stanu-z-komunikatem) -* [Zapisywanie bieżącego stanu wszystkich plików (ignorowanych, nieśledzonych i śledzonych)](#zapisywanie-bieżącego-stanu-wszystkich-plików-ignorowanych-nieśledzonych-i-śledzonych) -* [Pokaż listę wszystkich zapisanych stashes](#pokaż-listę-wszystkich-zapisanych-stashes) -* [Zastosuj dowolony stash bez usuwania z listy stashed](#zastosuj-dowolony-stash-bez-usuwania-z-listy-stashed) -* [Zastosuj ostatni stan stashed i usuń go z listy stashed](#zastosuj-ostatni-stan-stashed-i-usuń-go-z-listy-stashed) -* [Usuń wszystkie przechowywane stashes](#usuń-wszystkie-przechowywane-stashes) -* [Weź pojedynczy plik z pliku stash](#weź-pojedynczy-plik-z-pliku-stash) -* [Pokaż wszystkie śledzone pliki](#pokaż-wszystkie-śledzone-pliki) -* [Pokaż wszystkie nieśledzone pliki](#pokaż-wszystkie-nieśledzone-pliki) -* [Pokaż wszystkie zignorowane pliki](#pokaż-wszystkie-zignorowane-pliki) -* [Utwórz nowe drzewo robocze z repozytorium (git 2.5)](#utwórz-nowe-drzewo-robocze-z-repozytorium-git-2-5) -* [Utwórz nowe drzewo robocze ze stanu HEAD](#utwórz-nowe-drzewo-robocze-ze-stanu-head) -* [Przestań śledzić pliki bez usuwania](#przestań-śledzić-pliki-bez-usuwania) -* [Przed usunięciem nieśledzonych plików / katalogu, wykonaj próbę, aby uzyskać listę tych plików / katalogów](#przed-usunięciem-nieśledzonych-plików-katalogu-wykonaj-próbę-aby-uzyskać-listę-tych-plików-katalogów) -* [Wymuś usunięcie nieśledzonych plików](#wymuś-usunięcie-nieśledzonych-plików) -* [Wymuś usunięcie nieśledzonego katalogu](#wymuś-usunięcie-nieśledzonego-katalogu) -* [Zaktualizuj wszystkie submoduły](#zaktualizuj-wszystkie-submoduły) -* [Pokaż wszystkie zatwierdzenia w bieżącym branchu, które mają zostać zmergowane do mastera](#pokaż-wszystkie-zatwierdzenia-w-bieżącym-branchu-które-mają-zostać-zmergowane-do-mastera) -* [Zmień nazwę brancha](#zmień-nazwę-brancha) -* [Rebase 'feature' do 'master' i merguj to do master ](#rebase-feature-do-master-i-merguj-to-do-master) -* [Zarchiwizuj branch `master`](#zarchiwizuj-branch-master) -* [Zmodyfikuj poprzednie zatwierdzenie bez modyfikowania komunikatu zatwierdzenia](#zmodyfikuj-poprzednie-zatwierdzenie-bez-modyfikowania-komunikatu-zatwierdzenia) -* [Czyści odniesienia do zdalnych gałęzi, które zostały usunięte na zdalnym.](#czyści-odniesienia-do-zdalnych-gałęzi-które-zostały-usunięte-na-zdalnym) -* [Pobierz skrót zatwierdzenia z początkowej wersji.](#pobierz-skrót-zatwierdzenia-z-początkowej-wersji) -* [Wizualizuj drzewo wersji.](#wizualizuj-drzewo-wersji) -* [Wizualizuj drzewo, w tym zatwierdzenia, do których odwołuje się tylko dziennik rejestrów](#wizualizuj-drzewo-w-tym-zatwierdzenia-do-których-odwołuje-się-tylko-dziennik-rejestrów) -* [Wdrażanie podfolderu śledzonego przez git do gh-pages](#wdrażanie-podfolderu-śledzonego-przez-git-do-gh-pages) -* [Dodanie projektu do repozytorium za pomocą poddrzewa](#dodanie-projektu-do-repozytorium-za-pomocą-poddrzewa) -* [Pobierz najnowsze zmiany w repozytorium dla połączonego projektu za pomocą poddrzewa](#pobierz-najnowsze-zmiany-w-repozytorium-dla-połączonego-projektu-za-pomocą-poddrzewa) -* [Wyeksportuj gałąź z historią do pliku.](#wyeksportuj-gałąź-z-historią-do-pliku) -* [Importuj z pakietu](#importuj-z-pakietu) -* [Uzyskaj nazwę bieżącego brancha.](#uzyskaj-nazwę-bieżącego-brancha) -* [Zignoruj jeden plik przy zatwierdzaniu (np. Changelog).](#zignoruj-jeden-plik-przy-zatwierdzaniu-np-changelog) -* [Stashuj zmiany przed rebasing'iem](#stashuj-zmiany-przed-rebasingiem) -* [Pobierz pull request według identyfikatora do lokalnego brancha](#pobierz-pull-request-według-identyfikatora-do-lokalnego-brancha) -* [Pokaż najnowszy tag w bieżącym branchu.](#pokaż-najnowszy-tag-w-bieżącym-branchu) -* [Pokaż inline word diff.](#pokaż-inline-word-diff) -* [Pokaż zmiany używając narzędzi common diff.](#pokaż-zmiany-używając-narzędzi-common-diff) -* [Nie rozważaj zmian w śledzonym pliku.](#nie-rozważaj-zmian-w-śledzonym-pliku) -* [Cofnij assume-unchanged.](#cofnij-assume-unchanged) -* [Wyczyść pliki z `.gitignore`.](#wyczyść-pliki-z-gitignore) -* [Przywróć usunięty plik.](#przywróć-usunięty-plik) -* [Przywróć plik do określonego commit-hash](#przywróć-plik-do-określonego-commit-hash) -* [Zawsze rebase zamiast merge na pull.](#zawsze-rebase-zamiast-merge-na-pull) -* [Wyświetl wszystkie aliasy i konfiguracje.](#wyświetl-wszystkie-aliasy-i-konfiguracje) -* [Uwzględnij wielkość liter w git.](#uwzględnij-wielkość-liter-w-git) -* [Dodaj niestandardowe edytory.](#dodaj-niestandardowe-edytory) -* [Automatyczne poprawianie literówek.](#automatyczne-poprawianie-literówek) -* [Sprawdź, czy zmiana była częścią wydania.](#sprawdź-czy-zmiana-była-częścią-wydania) -* [Dry run. (dowolne polecenie obsługujące flagę dry-run powinno zrobić.)](#dry-run-dowolne-polecenie-obsługujące-flagę-dry-run-powinno-zrobić) -* [Oznacza twoje zatwierdzenie jako poprawkę poprzedniego zatwierdzenia.](#oznacza-twoje-zatwierdzenie-jako-poprawkę-poprzedniego-zatwierdzenia) +* [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so) +* [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git) +* [Search change by content](#search-change-by-content) +* [Show changes over time for specific file](#show-changes-over-time-for-specific-file) +* [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push) +* [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes) +* [List of all files till a commit](#list-of-all-files-till-a-commit) +* [Git reset first commit](#git-reset-first-commit) +* [Reset: preserve uncommitted local changes](#reset-preserve-uncommitted-local-changes) +* [List all the conflicted files](#list-all-the-conflicted-files) +* [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit) +* [Unstaged changes since last commit](#unstaged-changes-since-last-commit) +* [Changes staged for commit](#changes-staged-for-commit) +* [Show both staged and unstaged changes](#show-both-staged-and-unstaged-changes) +* [List all branches that are already merged into master](#list-all-branches-that-are-already-merged-into-master) +* [Quickly switch to the previous branch](#quickly-switch-to-the-previous-branch) +* [Remove branches that have already been merged with master](#remove-branches-that-have-already-been-merged-with-master) +* [List all branches and their upstreams, as well as last commit on branch](#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch) +* [Track upstream branch](#track-upstream-branch) +* [Delete local branch](#delete-local-branch) +* [Delete remote branch](#delete-remote-branch) +* [Delete local tag](#delete-local-tag) +* [Delete remote tag](#delete-remote-tag) +* [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head) +* [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit) +* [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch) +* [Reword the previous commit message](#reword-the-previous-commit-message) +* [See commit history for just the current branch](#see-commit-history-for-just-the-current-branch) +* [Amend author.](#amend-author) +* [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config) +* [Changing a remote's URL](#changing-a-remotes-url) +* [Get list of all remote references](#get-list-of-all-remote-references) +* [Get list of all local and remote branches](#get-list-of-all-local-and-remote-branches) +* [Get only remote branches](#get-only-remote-branches) +* [Stage parts of a changed file, instead of the entire file](#stage-parts-of-a-changed-file-instead-of-the-entire-file) +* [Get git bash completion](#get-git-bash-completion) +* [What changed since two weeks?](#what-changed-since-two-weeks) +* [See all commits made since forking from master](#see-all-commits-made-since-forking-from-master) +* [Pick commits across branches using cherry-pick](#pick-commits-across-branches-using-cherry-pick) +* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash) +* [Git Aliases](#git-aliases) +* [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting) +* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files) +* [Saving current state including untracked files](#saving-current-state-including-untracked-files) +* [Saving current state with message](#saving-current-state-with-message) +* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked) +* [Show list of all saved stashes](#show-list-of-all-saved-stashes) +* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) +* [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) +* [Delete all stored stashes](#delete-all-stored-stashes) +* [Grab a single file from a stash](#grab-a-single-file-from-a-stash) +* [Show all tracked files](#show-all-tracked-files) +* [Show all untracked files](#show-all-untracked-files) +* [Show all ignored files](#show-all-ignored-files) +* [Create new working tree from a repository (git 2.5)](#create-new-working-tree-from-a-repository-git-25) +* [Create new working tree from HEAD state](#create-new-working-tree-from-head-state) +* [Untrack files without deleting](#untrack-files-without-deleting) +* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories) +* [Forcefully remove untracked files](#forcefully-remove-untracked-files) +* [Forcefully remove untracked directory](#forcefully-remove-untracked-directory) +* [Update all the submodules](#update-all-the-submodules) +* [Show all commits in the current branch yet to be merged to master](#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) +* [Rename a branch](#rename-a-branch) +* [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) +* [Archive the `master` branch](#archive-the-master-branch) +* [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message) +* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) +* [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision) +* [Visualize the version tree.](#visualize-the-version-tree) +* [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs) +* [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages) +* [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree) +* [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree) +* [Export a branch with history to a file.](#export-a-branch-with-history-to-a-file) +* [Import from a bundle](#import-from-a-bundle) +* [Get the name of current branch.](#get-the-name-of-current-branch) +* [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog) +* [Stash changes before rebasing](#stash-changes-before-rebasing) +* [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch) +* [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch) +* [Show inline word diff.](#show-inline-word-diff) +* [Show changes using common diff tools.](#show-changes-using-common-diff-tools) +* [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file) +* [Undo assume-unchanged.](#undo-assume-unchanged) +* [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore) +* [Restore deleted file.](#restore-deleted-file) +* [Restore file to a specific commit-hash](#restore-file-to-a-specific-commit-hash) +* [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull) +* [List all the alias and configs.](#list-all-the-alias-and-configs) +* [Make git case sensitive.](#make-git-case-sensitive) +* [Add custom editors.](#add-custom-editors) +* [Auto correct typos.](#auto-correct-typos) +* [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release) +* [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do) +* [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit) * [Squash fixup commits normal commits.](#squash-fixup-commits-normal-commits) -* [Pomiń staging area podczas commitowania.](#pomiń-staging-area-podczas-commitowania) -* [Interaktywny staging.](#interaktywny-staging) -* [Lista ignorowanych plików.](#lista-ignorowanych-plików) -* [Status zignorowanych plików.](#status-zignorowanych-plików) -* [Commity w Branch1 które nie są w Branch2](#commity-w-Branch1-które-nie-są-w-Branch2) -* [Wyświetl listę n ostatnich commitów](#wyświetl-listę-n-ostatnich-commitów) -* [Ponownie użyj recorded resolution, record and reuse previous conflicts resolutions.](#ponownie-użyj-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) -* [Otwórz wszystkie skonfliktowane pliki w edytorze.](#otwórz-wszystkie-skonfliktowane-pliki-w-edytorze) -* [Policz wypakowaną liczbę obiektów i ich zużycie dysku.](#policz-wypakowaną-liczbę-obiektów-i-ich-zużycie-dysku) -* [Wyczyść wszystkie nieosiągalne obiekty z bazy danych obiektów.](#wyczyść-wszystkie-nieosiągalne-obiekty-z-bazy-danych-obiektów) -* [Natychmiast przeglądaj działające repozytorium w gitweb.](#natychmiast-przeglądaj-działające-repozytorium-w-gitweb) -* [Wyświetl podpisy GPG w dzienniku zatwierdzeń](#wyświetl-podpisy-gpg-w-dzienniku-zatwierdzeń) -* [Usuń wpis w globalnej konfiguracji.](#usuń-wpis-w-globalnej-konfiguracji) -* [Checkout nowego brancha bez historii](#checkout-nowego-brancha-bez-historii) -* [Wyodrębnij plik z innej gałęzi.](#wyodrębnij-plik-z-innej-gałęzi) -* [Wymień tylko root i merge commits.](#wymień-tylko-root-i-merge-commits) -* [Zmień poprzednie dwa zatwierdzenia za pomocą interaktywnego rebase.](#zmień-poprzednie-dwa-zatwierdzenia-za-pomocą-interaktywnego-rebase) -* [Wymień wszystkie gałęzie, których praca jest w toku (WIP)](#wymień-wszystkie-gałęzie-których-praca-jest-w-toku-wip) -* [Znajdź nieczyste korzystając z wyszukiwania binarnego](#znajdź-nieczyste-korzystając-z-wyszukiwania-binarnego) +* [Skip staging area during commit.](#skip-staging-area-during-commit) +* [Interactive staging.](#interactive-staging) +* [List ignored files.](#list-ignored-files) +* [Status of ignored files.](#status-of-ignored-files) +* [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) +* [List n last commits](#list-n-last-commits) +* [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) +* [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) +* [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) +* [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database) +* [Instantly browse your working repository in gitweb.](#instantly-browse-your-working-repository-in-gitweb) +* [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log) +* [Remove entry in the global config.](#remove-entry-in-the-global-config) +* [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history) +* [Extract file from another branch.](#extract-file-from-another-branch) +* [List only the root and merge commits.](#list-only-the-root-and-merge-commits) +* [Change previous two commits with an interactive rebase.](#change-previous-two-commits-with-an-interactive-rebase) +* [List all branch is WIP](#list-all-branch-is-wip) +* [Find guilty with binary search](#find-guilty-with-binary-search) * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks) -* [Lista zatwierdzeń i zmian w określonym pliku (nawet poprzez zmianę nazwy)](#lista-zatwierdzeń-i-zmian-w-określonym-pliku-nawet-poprzez-zmianę-nazwy) -* [Klonuj pojedynczy branch](#klonuj-pojedynczy-branch) -* [Utwórz i zmień nowy branch](#utwórz-i-zmień-nowy-branch) -* [Ignoruj tryb zmiany plików na commitach](#ignoruj-tryb-zmiany-plików-na-commitach) -* [Wyłącz git colored terminal output](#wyłącz-git-colored-terminal-output) -* [Określone ustawienia kolorów](#określone-ustawienia-kolorów) -* [Pokaż wszystkie lokalne branche uporządkowane według ostatnich commitów](#pokaż-wszystkie-lokalne-branche-uporządkowane-według-ostatnich-commitów) -* [Znajdź wiersze pasujące do wzorca (wyrażenia regularnego lub ciągu) w śledzonych plikach](#znajdź-wiersze-pasujące-do-wzorca-wyrażenia-regularnego-lub-ciągu-w-śledzonych-plikach) -* [Sklonuj płytką kopię repozytorium](#sklonuj-płytką-kopię-repozytorium) -* [Wyszukaj Commit log we wszystkich branchach dla podanego tekstu](#wyszukaj-commit-log-we-wszystkich-branchach-dla-podanego-tekstu) -* [Uzyskaj pierwszy commit w branchu (z master)](#uzyskaj-pierwszy-commit-w-branchu-z-master) +* [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming) +* [Clone a single branch](#clone-a-single-branch) +* [Create and switch new branch](#create-and-switch-new-branch) +* [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits) +* [Turn off git colored terminal output](#turn-off-git-colored-terminal-output) +* [Specific color settings](#specific-color-settings) +* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits) +* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files) +* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository) +* [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text) +* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master) * [Unstaging Staged file](#unstaging-staged-file) -* [Wymuś wypchnięcie do zdalnego repozytorium](#wymuś-wypchnięcie-do-zdalnego-repozytorium) -* [Dodawanie nazwy zdalnej](#dodawanie-nazwy-zdalnej) -* [Wyświetl listę wszystkich aktualnie skonfigurowanych zdalnych](#wyświetl-listę-wszystkich-aktualnie-skonfigurowanych-zdalnych) -* [Pokaż autora, czas i ostatnią wersję dokonaną w każdej linii danego pliku](#pokaż-autora-czas-i-ostatnią-wersję-dokonaną-w-każdej-linii-danego-pliku) -* [Grupuj commity według autorów i tytułów](#grupuj-commity-według-autorów-i-tytułów) -* [Wymuś pusha, ale nadal upewnij się, że nie nadpisujesz pracy innych](#wymuś-pusha-ale-nadal-upewnij-się-że-nie-nadpisujesz-pracy-innych) -* [Pokaż, ile wierszy ma współautor](#pokaż-ile-wierszy-ma-współautor) -* [Cofnij: Cofnięcie całego merge](#cofnij-cofnięcie-całego-merge) -* [Liczba commitów w branchu](#liczba-commitów-w-branchu) -* [Alias: git undo - cofnij](#alias-git-undo-cofnij) -* [Dodaj notatkę obiektu](#dodaj-notatkę-obiektu) -* [Pokaż wszystkie git-notes](#pokaż-wszystkie-git-notes) -* [Zastosuj commit z innego repozytorium](#zastosuj-commit-z-innego-repozytorium) +* [Force push to Remote Repository](#force-push-to-remote-repository) +* [Adding Remote name](#adding-remote-name) +* [List all currently configured remotes](#list-all-currently-configured-remotes) +* [Show the author, time and last revision made to each line of a given file](#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file) +* [Group commits by authors and title](#group-commits-by-authors-and-title) +* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work) +* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute) +* [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge) +* [Number of commits in a branch](#number-of-commits-in-a-branch) +* [Alias: git undo](#alias-git-undo) +* [Add object notes](#add-object-notes) +* [Show all the git-notes](#show-all-the-git-notes) +* [Apply commit from another repository](#apply-commit-from-another-repository) * [Specific fetch reference](#specific-fetch-reference) -* [Znajdź wspólnego przodka dwóch gałęzi](#znajdź-wspólnego-przodka-dwóch-gałęzi) -* [Wyświetl unpushed git commits](#wyświetl-unpushed-git-commits) -* [Dodaj wszystko, ale bez zmiany białych znaków](#dodaj-wszystko-ale-bez-zmiany-białych-znaków) -* [Edytuj [local/global] git config](#edytuj-local-global-git-config) -* [Blame on certain range](#blame-on-certain-range) -* [Pokaż zmienną logiczną Git.](#pokaż-zmienną-logiczną-git) +* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) +* [List unpushed git commits](#list-unpushed-git-commits) +* [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) +* [Edit [local/global] git config](#edit-localglobal-git-config) +* [blame on certain range](#blame-on-certain-range) +* [Show a Git logical variable.](#show-a-git-logical-variable) * [Preformatted patch file.](#preformatted-patch-file) -* [Uzyskaj nazwę repozytorium.](#uzyskaj-nazwę-repozytorium) -* [Logi między zakresem dat](#logi-między-zakresem-dat) -* [Wyklucz autora z logów](#wyklucz-autora-z-logów) -* [Generuj podsumowanie oczekujących zmian](#generuj-podsumowanie-oczekujących-zmian) -* [Lista referencji w zdalnym repozytorium](#lista-referencji-w-zdalnym-repozytorium) -* [Utwórz kopię zapasową nieśledzonych plików.](#utwórz-kopię-zapasową-nieśledzonych-plików) -* [Wyświetl wszystkie aliasy git](#wyświetl-wszystkie-aliasy-git) -* [Pokaż git status short](#pokaż-git-status-short) -* [Sprawdź commit sprzed dnia](#sprawdź-commit-sprzed-dnia) -* [Popchnij nowy branch lokalny do zdalnego repozytorium i śledź](#popchnij-nowy-branch-lokalny-do-zdalnego-repozytorium-i-śledź) -* [Zmień branch base](#zmień-branch-base) -* [Użyj SSH zamiast HTTPs dla remotes](#użyj-ssh-zamiast-https-dla-remotes) -* [Zaktualizuj submoduł do najnowszego commita](#zaktualizuj-submoduł-do-najnowszego-commita) -* [Zapobiegaj automatycznemu zastępowaniu LF przez CRLF](#zapobiegaj-automatycznemu-zastępowaniu-lf-przez-crlf) +* [Get the repo name.](#get-the-repo-name) +* [logs between date range](#logs-between-date-range) +* [Exclude author from logs](#exclude-author-from-logs) +* [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) +* [List references in a remote repository](#list-references-in-a-remote-repository) +* [Backup untracked files.](#backup-untracked-files) +* [List all git aliases](#list-all-git-aliases) +* [Show git status short](#show-git-status-short) +* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) +* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) +* [Change a branch base](#change-a-branch-base) +* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) +* [Update a submodule to the latest commit](#update-a-submodule-to-the-latest-commit) +* [Prevent auto replacing LF with CRLF](#prevent-auto-replacing-lf-with-crlf) @@ -181,131 +181,131 @@ P.S: Wszystkie te polecenia są testowane na `git version 2.7.4 (Apple Git-66)`. -## Codziennie Git w około dwudziestu poleceniach +## Everyday Git in twenty commands or so ```sh git help everyday ``` -## Pokaż przydatne przewodniki dla Git +## Show helpful guides that come with Git ```sh git help -g ``` -## Wyszukaj zmianę według zawartości +## Search change by content ```sh git log -S'' ``` -## Pokaż zmiany w czasie dla określonego pliku +## Show changes over time for specific file ```sh git log -p ``` -## Usuń wrażliwe dane z historii po push +## Remove sensitive data from history, after a push ```sh git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all ``` -## Synchronizuj ze zdalnym, zastępuj lokalne zmiany +## Sync with remote, overwrite local changes ```sh git fetch origin && git reset --hard origin/master && git clean -f -d ``` -## Lista wszystkich plików do commita +## List of all files till a commit ```sh git ls-tree --name-only -r ``` -## Git zresetuj pierwszy commit +## Git reset first commit ```sh git update-ref -d HEAD ``` -## Reset: zachowaj niezatwierdzone zmiany lokalne +## Reset: preserve uncommitted local changes ```sh git reset --keep ``` -## Wyświetl wszystkie skonfliktowane pliki +## List all the conflicted files ```sh git diff --name-only --diff-filter=U ``` -## Lista wszystkich plików zmienionych w commitcie +## List of all files changed in a commit ```sh git diff-tree --no-commit-id --name-only -r ``` -## Zmienione ale niezaktualizowane zmiany od ostatniego zatwierdzenia +## Unstaged changes since last commit ```sh git diff ``` -## Porównanie zmian z poczekalni z ostatnią zmianą +## Changes staged for commit ```sh git diff --cached ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git diff --staged ``` -## Pokaż wszystkie zmiany w śledzonych plikach. +## Show both staged and unstaged changes ```sh git diff HEAD ``` -## Lista wszystkich gałęzi, które są już zmergowane do mastera +## List all branches that are already merged into master ```sh git branch --merged master ``` -## Szybko przełącz na poprzednią gałąź +## Quickly switch to the previous branch ```sh git checkout - ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git checkout @{-1} ``` -## Usuń gałęzie które zostały już połączone z master +## Remove branches that have already been merged with master ```sh git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out ``` -## Wymień wszystkie gałęzie i ich wyższe poziomy, a także ostatnie zatwierdzenie na gałęzi +## List all branches and their upstreams, as well as last commit on branch ```sh git branch -vv ``` -## Śledź odgałęzienie +## Track upstream branch ```sh git branch -u origin/mybranch ``` -## Usuń lokalną gałąź +## Delete local branch ```sh git branch -d ``` -## Usuń zdalną gałąź +## Delete remote branch ```sh git push origin --delete ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git push origin : ``` @@ -315,143 +315,143 @@ git push origin : git branch -dr ``` -## Usuń lokalny tag +## Delete local tag ```sh git tag -d ``` -## Usuń zdalny tag +## Delete remote tag ```sh git push origin :refs/tags/ ``` -## Cofnij zmiany lokalne z ostatnią zawartością w head +## Undo local changes with the last content in head ```sh git checkout -- ``` -## Cofnij: Cofnij commita, tworząc nowego commita +## Revert: Undo a commit by creating a new commit ```sh git revert ``` -## Reset: Odrzuć commity, zalecane dla prywatnej gałęzi +## Reset: Discard commits, advised for private branch ```sh git reset ``` -## Zmień kolejność poprzedniej wiadomości commita +## Reword the previous commit message ```sh git commit -v --amend ``` -## Zobacz historię zatwierdzeń tylko dla bieżącej gałęzi +## See commit history for just the current branch ```sh git cherry -v master ``` -## Zmień autora. +## Amend author. ```sh git commit --amend --author='Author Name ' ``` -## Resetuj autora po zmianie autora w global config. +## Reset author, after author has been changed in the global config. ```sh git commit --amend --reset-author --no-edit ``` -## Zmiana zdalnego adresu URL +## Changing a remote's URL ```sh git remote set-url origin ``` -## Uzyskaj listę wszystkich zdalnych referencji +## Get list of all remote references ```sh git remote ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git remote show ``` -## Uzyskaj listę wszystkich lokalnych i zdalnych gałęzi +## Get list of all local and remote branches ```sh git branch -a ``` -## Uzyskaj tylko zdalne gałęzie +## Get only remote branches ```sh git branch -r ``` -## Śledź części zmienionego pliku zamiast całego pliku +## Stage parts of a changed file, instead of the entire file ```sh git add -p ``` -## Uzyskaj ukończenie git bash +## Get git bash completion ```sh curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc ``` -## Co zmieniło się od dwóch tygodni? +## What changed since two weeks? ```sh git log --no-merges --raw --since='2 weeks ago' ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git whatchanged --since='2 weeks ago' ``` -## Zobacz wszystkie zatwierdzenia dokonane od czasu forkowania z mastera +## See all commits made since forking from master ```sh git log --no-merges --stat --reverse master.. ``` -## Wybierz zatwierdzenia między gałęziami za pomocą cherry-pick +## Pick commits across branches using cherry-pick ```sh git checkout && git cherry-pick ``` -## Znajdź gałęzie zawierające commit-hash +## Find out branches containing commit-hash ```sh git branch -a --contains ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git branch --contains ``` -## Aliasy Gita +## Git Aliases ```sh git config --global alias. git config --global alias.st status ``` -## Zapisywanie bieżącego stanu śledzonych plików bez zatwierdzania +## Saving current state of tracked files without commiting ```sh git stash ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash save ``` -## Zapisywanie aktualnego stanu zmian unstaged do śledzonych plików +## Saving current state of unstaged changes to tracked files ```sh git stash -k ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash --keep-index ``` @@ -461,13 +461,13 @@ git stash --keep-index git stash save --keep-index ``` -## Zapisywanie bieżącego stanu, w tym nieśledzonych plików +## Saving current state including untracked files ```sh git stash -u ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash save -u ``` @@ -477,18 +477,18 @@ git stash save -u git stash save --include-untracked ``` -## Zapisywanie aktualnego stanu z komunikatem +## Saving current state with message ```sh git stash save ``` -## Zapisywanie bieżącego stanu wszystkich plików (ignorowanych, nieśledzonych i śledzonych) +## Saving current state of all files (ignored, untracked, and tracked) ```sh git stash -a ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash --all ``` @@ -498,107 +498,107 @@ git stash --all git stash save --all ``` -## Pokaż listę wszystkich zapisanych stashes +## Show list of all saved stashes ```sh git stash list ``` -## Zastosuj dowolony stash bez usuwania z listy stashed +## Apply any stash without deleting from the stashed list ```sh git stash apply ``` -## Zastosuj ostatni stan stashed i usuń go z listy stashed +## Apply last stashed state and delete it from stashed list ```sh git stash pop ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash apply stash@{0} && git stash drop stash@{0} ``` -## Usuń wszystkie przechowywane stashes +## Delete all stored stashes ```sh git stash clear ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git stash drop ``` -## Weź pojedynczy plik z pliku stash +## Grab a single file from a stash ```sh git checkout -- ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git checkout stash@{0} -- ``` -## Pokaż wszystkie śledzone pliki +## Show all tracked files ```sh git ls-files -t ``` -## Pokaż wszystkie nieśledzone pliki +## Show all untracked files ```sh git ls-files --others ``` -## Pokaż wszystkie zignorowane pliki +## Show all ignored files ```sh git ls-files --others -i --exclude-standard ``` -## Utwórz nowe drzewo robocze z repozytorium (git 2.5) +## Create new working tree from a repository (git 2.5) ```sh git worktree add -b ``` -## Utwórz nowe drzewo robocze ze stanu HEAD +## Create new working tree from HEAD state ```sh git worktree add --detach HEAD ``` -## Przestań śledzić pliki bez usuwania +## Untrack files without deleting ```sh git rm --cached ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git rm --cached -r ``` -## Przed usunięciem nieśledzonych plików / katalogu, wykonaj próbę, aby uzyskać listę tych plików / katalogów +## Before deleting untracked files/directory, do a dry run to get the list of these files/directories ```sh git clean -n ``` -## Wymuś usunięcie nieśledzonych plików +## Forcefully remove untracked files ```sh git clean -f ``` -## Wymuś usunięcie nieśledzonego katalogu +## Forcefully remove untracked directory ```sh git clean -f -d ``` -## Zaktualizuj wszystkie submoduły +## Update all the submodules ```sh git submodule foreach git pull ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git submodule update --init --recursive ``` @@ -608,61 +608,61 @@ git submodule update --init --recursive git submodule update --remote ``` -## Pokaż wszystkie zatwierdzenia w bieżącym branchu, które mają zostać zmergowane do mastera +## Show all commits in the current branch yet to be merged to master ```sh git cherry -v master ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git cherry -v master ``` -## Zmień nazwę brancha +## Rename a branch ```sh git branch -m ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git branch -m [] ``` -## Rebase 'feature' do 'master' i merguj to do master +## Rebases 'feature' to 'master' and merges it in to master ```sh git rebase master feature && git checkout master && git merge - ``` -## Zarchiwizuj branch `master` +## Archive the `master` branch ```sh git archive master --format=zip --output=master.zip ``` -## Zmodyfikuj poprzednie zatwierdzenie bez modyfikowania komunikatu zatwierdzenia +## Modify previous commit without modifying the commit message ```sh git add --all && git commit --amend --no-edit ``` -## Czyści odniesienia do zdalnych gałęzi, które zostały usunięte na zdalnym. +## Prunes references to remote branches that have been deleted in the remote. ```sh git fetch -p ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git remote prune origin ``` -## Pobierz skrót zatwierdzenia z początkowej wersji. +## Retrieve the commit hash of the initial revision. ```sh git rev-list --reverse HEAD | head -1 ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git rev-list --max-parents=0 HEAD ``` @@ -677,13 +677,13 @@ git log --pretty=oneline | tail -1 | cut -c 1-40 git log --pretty=oneline --reverse | head -1 | cut -c 1-40 ``` -## Wizualizuj drzewo wersji. +## Visualize the version tree. ```sh git log --pretty=oneline --graph --decorate --all ``` -__Alternatywnie:__ +__Alternatives:__ ```sh gitk --all ``` @@ -693,145 +693,145 @@ gitk --all git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d' ``` -## Wizualizuj drzewo, w tym zatwierdzenia, do których odwołuje się tylko dziennik rejestrów +## Visualize the tree including commits that are only referenced from reflogs ```sh git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all) ``` -## Wdrażanie podfolderu śledzonego przez git do gh-pages +## Deploying git tracked subfolder to gh-pages ```sh git subtree push --prefix subfolder_name origin gh-pages ``` -## Dodanie projektu do repozytorium za pomocą poddrzewa +## Adding a project to repo using subtree ```sh git subtree add --prefix=/ --squash git@github.com:/.git master ``` -## Pobierz najnowsze zmiany w repozytorium dla połączonego projektu za pomocą poddrzewa +## Get latest changes in your repo for a linked project using subtree ```sh git subtree pull --prefix=/ --squash git@github.com:/.git master ``` -## Wyeksportuj gałąź z historią do pliku. +## Export a branch with history to a file. ```sh git bundle create ``` -## Importuj z pakietu +## Import from a bundle ```sh git clone repo.bundle -b ``` -## Uzyskaj nazwę bieżącego brancha. +## Get the name of current branch. ```sh git rev-parse --abbrev-ref HEAD ``` -## Zignoruj jeden plik przy zatwierdzaniu (np. Changelog). +## Ignore one file on commit (e.g. Changelog). ```sh git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog ``` -## Stashuj zmiany przed rebasing'iem +## Stash changes before rebasing ```sh git rebase --autostash ``` -## Pobierz pull request według identyfikatora do lokalnego brancha +## Fetch pull request by ID to a local branch ```sh git fetch origin pull//head: ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git pull origin pull//head: ``` -## Pokaż najnowszy tag w bieżącym branchu. +## Show the most recent tag on the current branch. ```sh git describe --tags --abbrev=0 ``` -## Pokaż inline word diff. +## Show inline word diff. ```sh git diff --word-diff ``` -## Pokaż zmiany używając narzędzi common diff. +## Show changes using common diff tools. ```sh git difftool [-t ] ``` -## Nie rozważaj zmian w śledzonym pliku. +## Don’t consider changes for tracked file. ```sh git update-index --assume-unchanged ``` -## Cofnij assume-unchanged. +## Undo assume-unchanged. ```sh git update-index --no-assume-unchanged ``` -## Wyczyść pliki z `.gitignore`. +## Clean the files from `.gitignore`. ```sh git clean -X -f ``` -## Przywróć usunięty plik. +## Restore deleted file. ```sh git checkout ^ -- ``` -## Przywróć plik do określonego commit-hash +## Restore file to a specific commit-hash ```sh git checkout -- ``` -## Zawsze rebase zamiast merge na pull. +## Always rebase instead of merge on pull. ```sh git config --global pull.rebase true ``` -__Alternatywnie:__ +__Alternatives:__ ```sh #git < 1.7.9 git config --global branch.autosetuprebase always ``` -## Wyświetl wszystkie aliasy i konfiguracje. +## List all the alias and configs. ```sh git config --list ``` -## Uwzględnij wielkość liter w git. +## Make git case sensitive. ```sh git config --global core.ignorecase false ``` -## Dodaj niestandardowe edytory. +## Add custom editors. ```sh git config --global core.editor '$EDITOR' ``` -## Automatyczne poprawianie literówek. +## Auto correct typos. ```sh git config --global help.autocorrect 1 ``` -## Sprawdź, czy zmiana była częścią wydania. +## Check if the change was a part of a release. ```sh git name-rev --name-only ``` -## Dry run. (dowolne polecenie obsługujące flagę dry-run powinno zrobić.) +## Dry run. (any command that supports dry-run flag should do.) ```sh git clean -fd --dry-run ``` -## Oznacza twoje zatwierdzenie jako poprawkę poprzedniego zatwierdzenia. +## Marks your commit as a fix of a previous commit. ```sh git commit --fixup ``` @@ -841,103 +841,103 @@ git commit --fixup git rebase -i --autosquash ``` -## Pomiń staging area podczas commitowania. +## Skip staging area during commit. ```sh git commit --only ``` -## Interaktywny staging. +## Interactive staging. ```sh git add -i ``` -## Lista ignorowanych plików. +## List ignored files. ```sh git check-ignore * ``` -## Status zignorowanych plików. +## Status of ignored files. ```sh git status --ignored ``` -## Commity w Branch1 które nie są w Branch2 +## Commits in Branch1 that are not in Branch2 ```sh git log Branch1 ^Branch2 ``` -## Wyświetl listę n ostatnich commitów +## List n last commits ```sh git log - ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git log -n ``` -## Ponownie użyj recorded resolution, record and reuse previous conflicts resolutions. +## Reuse recorded resolution, record and reuse previous conflicts resolutions. ```sh git config --global rerere.enabled 1 ``` -## Otwórz wszystkie skonfliktowane pliki w edytorze. +## Open all conflicted files in an editor. ```sh git diff --name-only | uniq | xargs $EDITOR ``` -## Policz wypakowaną liczbę obiektów i ich zużycie dysku. +## Count unpacked number of objects and their disk consumption. ```sh git count-objects --human-readable ``` -## Wyczyść wszystkie nieosiągalne obiekty z bazy danych obiektów. +## Prune all unreachable objects from the object database. ```sh git gc --prune=now --aggressive ``` -## Natychmiast przeglądaj działające repozytorium w gitweb. +## Instantly browse your working repository in gitweb. ```sh git instaweb [--local] [--httpd=] [--port=] [--browser=] ``` -## Wyświetl podpisy GPG w dzienniku zatwierdzeń +## View the GPG signatures in the commit log ```sh git log --show-signature ``` -## Usuń wpis w globalnej konfiguracji. +## Remove entry in the global config. ```sh git config --global --unset ``` -## Checkout nowego brancha bez historii +## Checkout a new branch without any history ```sh git checkout --orphan ``` -## Wyodrębnij plik z innej gałęzi. +## Extract file from another branch. ```sh git show : ``` -## Wymień tylko root i merge commits. +## List only the root and merge commits. ```sh git log --first-parent ``` -## Zmień poprzednie dwa zatwierdzenia za pomocą interaktywnego rebase. +## Change previous two commits with an interactive rebase. ```sh git rebase --interactive HEAD~2 ``` -## Wymień wszystkie gałęzie, których praca jest w toku (WIP) +## List all branch is WIP ```sh git checkout master && git branch --no-merged ``` -## Znajdź nieczyste korzystając z wyszukiwania binarnego +## Find guilty with binary search ```sh git bisect start # Search start git bisect bad # Set point to bad commit @@ -953,69 +953,69 @@ git bisect reset # Finish search git commit --no-verify ``` -## Lista zatwierdzeń i zmian w określonym pliku (nawet poprzez zmianę nazwy) +## List commits and changes to a specific file (even through renaming) ```sh git log --follow -p -- ``` -## Klonuj pojedynczy branch +## Clone a single branch ```sh git clone -b --single-branch https://github.com/user/repo.git ``` -## Utwórz i zmień nowy branch +## Create and switch new branch ```sh git checkout -b ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git branch && git checkout ``` -## Ignoruj tryb zmiany plików na commitach +## Ignore file mode changes on commits ```sh git config core.fileMode false ``` -## Wyłącz git colored terminal output +## Turn off git colored terminal output ```sh git config --global color.ui false ``` -## Określone ustawienia kolorów +## Specific color settings ```sh git config --global ``` -## Pokaż wszystkie lokalne branche uporządkowane według ostatnich commitów +## Show all local branches ordered by recent commits ```sh git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ ``` -## Znajdź wiersze pasujące do wzorca (wyrażenia regularnego lub ciągu) w śledzonych plikach +## Find lines matching the pattern (regex or string) in tracked files ```sh git grep --heading --line-number 'foo bar' ``` -## Sklonuj płytką kopię repozytorium +## Clone a shallow copy of a repository ```sh git clone https://github.com/user/repo.git --depth 1 ``` -## Wyszukaj Commit log we wszystkich branchach dla podanego tekstu +## Search Commit log across all branches for given text ```sh git log --all --grep='' ``` -## Uzyskaj pierwszy commit w branchu (z master) +## Get first commit in a branch (from master) ```sh git log --oneline master.. | tail -1 ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git log --reverse master.. | head -6 ``` @@ -1025,75 +1025,75 @@ git log --reverse master.. | head -6 git reset HEAD ``` -## Wymuś wypchnięcie do zdalnego repozytorium +## Force push to Remote Repository ```sh git push -f ``` -## Dodawanie nazwy zdalnej +## Adding Remote name ```sh git remote add ``` -## Wyświetl listę wszystkich aktualnie skonfigurowanych zdalnych +## List all currently configured remotes ```sh git remote -v ``` -## Pokaż autora, czas i ostatnią wersję dokonaną w każdej linii danego pliku +## Show the author, time and last revision made to each line of a given file ```sh git blame ``` -## Grupuj commity według autorów i tytułów +## Group commits by authors and title ```sh git shortlog ``` -## Wymuś pusha, ale nadal upewnij się, że nie nadpisujesz pracy innych +## Forced push but still ensure you don't overwrite other's work ```sh git push --force-with-lease ``` -## Pokaż, ile wierszy ma współautor +## Show how many lines does an author contribute ```sh git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += ; subs += ; loc += - } END { printf "added lines: %s removed lines: %s total lines: %s ", add, subs, loc }' - ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += ; subs += ; loc += - } END { printf "added lines: %s, removed lines: %s, total lines: %s ", add, subs, loc }' - # on Mac OSX ``` -## Cofnij: Cofnięcie całego merge +## Revert: Reverting an entire merge ```sh git revert -m 1 ``` -## Liczba commitów w branchu +## Number of commits in a branch ```sh git rev-list --count ``` -## Alias: git undo - cofnij +## Alias: git undo ```sh git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' ``` -## Dodaj notatkę obiektu +## Add object notes ```sh git notes add -m 'Note on the previous commit....' ``` -## Pokaż wszystkie git-notes +## Show all the git-notes ```sh git log --show-notes='*' ``` -## Zastosuj commit z innego repozytorium +## Apply commit from another repository ```sh git --git-dir=/.git format-patch -k -1 --stdout | git am -3 -k ``` @@ -1103,18 +1103,18 @@ git --git-dir=/.git format-patch -k -1 --stdout | git am -3 - git fetch origin master:refs/remotes/origin/mymaster ``` -## Znajdź wspólnego przodka dwóch gałęzi +## Find common ancestor of two branches ```sh git merge-base ``` -## Wyświetl unpushed git commits +## List unpushed git commits ```sh git log --branches --not --remotes ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git log @{u}.. ``` @@ -1124,12 +1124,12 @@ git log @{u}.. git cherry -v ``` -## Dodaj wszystko, ale bez zmiany białych znaków +## Add everything, but whitespace changes ```sh git diff --ignore-all-space | git apply --cached ``` -## Edytuj [local/global] git config +## Edit [local/global] git config ```sh git config [--global] --edit ``` @@ -1139,7 +1139,7 @@ git config [--global] --edit git blame -L , ``` -## Pokaż zmienną logiczną Git. +## Show a Git logical variable. ```sh git var -l | ``` @@ -1149,74 +1149,74 @@ git var -l | git format-patch -M upstream..topic ``` -## Uzyskaj nazwę repozytorium. +## Get the repo name. ```sh git rev-parse --show-toplevel ``` -## logi między zakresem dat +## logs between date range ```sh git log --since='FEB 1 2017' --until='FEB 14 2017' ``` -## Wyklucz autora z logów +## Exclude author from logs ```sh git log --perl-regexp --author='^((?!excluded-author-regex).*) ``` -## Generuj podsumowanie oczekujących zmian +## Generates a summary of pending changes ```sh git request-pull v1.0 https://git.ko.xz/project master:for-linus ``` -## Lista referencji w zdalnym repozytorium +## List references in a remote repository ```sh git ls-remote git://git.kernel.org/pub/scm/git/git.git ``` -## Utwórz kopię zapasową nieśledzonych plików. +## Backup untracked files. ```sh git ls-files --others -i --exclude-standard | xargs zip untracked.zip ``` -## Wyświetl wszystkie aliasy git +## List all git aliases ```sh git config -l | grep alias | sed 's/^alias\.//g' ``` -__Alternatywnie:__ +__Alternatives:__ ```sh git config -l | grep alias | cut -d '.' -f 2 ``` -## Pokaż git status short +## Show git status short ```sh git status --short --branch ``` -## Sprawdź commit sprzed dnia +## Checkout a commit prior to a day ago ```sh git checkout master@{yesterday} ``` -## Popchnij nowy branch lokalny do zdalnego repozytorium i śledź +## Push a new local branch to remote repository and track ```sh git push -u origin ``` -## Zmień branch base +## Change a branch base ```sh git rebase --onto ``` -## Użyj SSH zamiast HTTPs dla remotes +## Use SSH instead of HTTPs for remotes ```sh git config --global url.'git@github.com:'.insteadOf 'https://github.com/' ``` -## Zaktualizuj submoduł do najnowszego commita +## Update a submodule to the latest commit ```sh cd git pull origin @@ -1225,7 +1225,7 @@ git add git commit -m "submodule updated" ``` -## Zapobiegaj automatycznemu zastępowaniu LF przez CRLF +## Prevent auto replacing LF with CRLF ```sh git config --global core.autocrlf false ``` From e89eb24e670c6baf8d2c9944319323e5dc59bdd7 Mon Sep 17 00:00:00 2001 From: rednik96 Date: Sun, 3 May 2020 13:56:09 +0200 Subject: [PATCH 235/251] replacing `git stash save` by `git stash push` `git stash save` -> This option is deprecated in favour of git stash push. [git docs](https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-save-p--patch-k--no-keep-index-u--include-untracked-a--all-q--quietltmessagegt) --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0e69629..471ca71 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,7 @@ git stash __Alternatives:__ ```sh -git stash save +git stash push ``` ## Saving current state of unstaged changes to tracked files @@ -458,7 +458,7 @@ git stash --keep-index ```sh -git stash save --keep-index +git stash push --keep-index ``` ## Saving current state including untracked files @@ -469,17 +469,23 @@ git stash -u __Alternatives:__ ```sh -git stash save -u +git stash push -u ``` ```sh -git stash save --include-untracked +git stash push --include-untracked ``` ## Saving current state with message ```sh -git stash save +git stash push -m +``` + + +__Alternatives:__ +```sh +git stash push --message ``` ## Saving current state of all files (ignored, untracked, and tracked) @@ -495,7 +501,7 @@ git stash --all ```sh -git stash save --all +git stash push --all ``` ## Show list of all saved stashes From 36c15874fd5196517b55a38c627f3dc5ffc84e43 Mon Sep 17 00:00:00 2001 From: biesiadamich <60202305+biesiadamich@users.noreply.github.com> Date: Thu, 7 May 2020 23:18:04 +0200 Subject: [PATCH 236/251] update readme (#185) added Polish link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e69629..fd5b47f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) | [Polski](https://github.com/mbiesiad/tips) ### __Tools:__ From 8305c4a4c6534cd298588900a525740bafb971e9 Mon Sep 17 00:00:00 2001 From: Adrian Skar Date: Thu, 16 Jul 2020 17:41:10 +0200 Subject: [PATCH 237/251] alternatives: create and switch new branch Add alternative to `996 ## Create and switch new branch` using git switch ref: https://git-scm.com/docs/git-switch --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fd5b47f..40015ee 100644 --- a/README.md +++ b/README.md @@ -974,6 +974,10 @@ __Alternatives:__ git branch && git checkout ``` +```sh +git switch -c +``` + ## Ignore file mode changes on commits ```sh git config core.fileMode false From 442d880d4cb869f05bdf8e81706e71e66e63edc4 Mon Sep 17 00:00:00 2001 From: Edy Cu Date: Thu, 30 Jul 2020 19:40:51 +0700 Subject: [PATCH 238/251] Fix typo extra caret in git command Restore delete file. --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd5b47f..050cc53 100644 --- a/README.md +++ b/README.md @@ -781,7 +781,7 @@ git clean -X -f ## Restore deleted file. ```sh -git checkout ^ -- +git checkout -- ``` ## Restore file to a specific commit-hash diff --git a/tips.json b/tips.json index 3400539..21c65a4 100644 --- a/tips.json +++ b/tips.json @@ -278,7 +278,7 @@ "tip": "git clean -X -f" }, { "title": "Restore deleted file.", - "tip": "git checkout ^ -- " + "tip": "git checkout -- " }, { "title": "Restore file to a specific commit-hash", "tip": "git checkout -- " From 767360112f4c6bc58e68eae96b93cd6bb886dade Mon Sep 17 00:00:00 2001 From: "Gaushik M.R" Date: Fri, 31 Jul 2020 10:14:03 -0400 Subject: [PATCH 239/251] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e96f702 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at hemanth.hm@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From d1835c92dfda88663fd444380a18b7f7b40ee875 Mon Sep 17 00:00:00 2001 From: Edy Cu Date: Tue, 25 Aug 2020 23:15:27 +0700 Subject: [PATCH 240/251] Split git variable to avoid confusion symbol vertical line for pipeline and OR --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd5b47f..2533c89 100644 --- a/README.md +++ b/README.md @@ -1139,9 +1139,14 @@ git config [--global] --edit git blame -L , ``` -## Show a Git logical variable. +## List all Git variable. ```sh -git var -l | +git var -l +``` + +## Show a Git specific variable. +```sh +git var ``` ## Preformatted patch file. From 97047c7560a70e79b9a21ef691752ec22b9c8047 Mon Sep 17 00:00:00 2001 From: Adrian Skar Date: Sat, 19 Dec 2020 12:00:49 +0100 Subject: [PATCH 241/251] add[alternative]: create and switch branch From #186. --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 21c65a4..b3fa5c6 100644 --- a/tips.json +++ b/tips.json @@ -380,7 +380,7 @@ }, { "title": "Create and switch new branch", "tip": "git checkout -b ", - "alternatives": ["git branch && git checkout "] + "alternatives": ["git branch && git checkout ", "git switch -c "] }, { "title": "Ignore file mode changes on commits", "tip": "git config core.fileMode false" From 6b2007ab79b29cf21f7b52c34089f374a4c796b2 Mon Sep 17 00:00:00 2001 From: rednik96 Date: Sun, 10 Jan 2021 11:41:46 +0100 Subject: [PATCH 242/251] Revert "replacing `git stash save` by `git stash push`" This reverts commit e89eb24e670c6baf8d2c9944319323e5dc59bdd7. --- README.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 471ca71..0e69629 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,7 @@ git stash __Alternatives:__ ```sh -git stash push +git stash save ``` ## Saving current state of unstaged changes to tracked files @@ -458,7 +458,7 @@ git stash --keep-index ```sh -git stash push --keep-index +git stash save --keep-index ``` ## Saving current state including untracked files @@ -469,23 +469,17 @@ git stash -u __Alternatives:__ ```sh -git stash push -u +git stash save -u ``` ```sh -git stash push --include-untracked +git stash save --include-untracked ``` ## Saving current state with message ```sh -git stash push -m -``` - - -__Alternatives:__ -```sh -git stash push --message +git stash save ``` ## Saving current state of all files (ignored, untracked, and tracked) @@ -501,7 +495,7 @@ git stash --all ```sh -git stash push --all +git stash save --all ``` ## Show list of all saved stashes From 0eb60008aad02c301fe8bf8bb9d268dd3cb18e0e Mon Sep 17 00:00:00 2001 From: rednik96 Date: Sun, 10 Jan 2021 11:46:57 +0100 Subject: [PATCH 243/251] replacing `git stash save` by `git stash push` --- tips.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tips.json b/tips.json index 3400539..9ad6945 100644 --- a/tips.json +++ b/tips.json @@ -131,22 +131,23 @@ }, { "title": "Saving current state of tracked files without commiting", "tip": "git stash", - "alternatives": ["git stash save"] + "alternatives": ["git stash push"] }, { "title": "Saving current state of unstaged changes to tracked files", "tip": "git stash -k", - "alternatives": ["git stash --keep-index", "git stash save --keep-index"] + "alternatives": ["git stash --keep-index", "git stash push --keep-index"] }, { "title": "Saving current state including untracked files", "tip": "git stash -u", - "alternatives": ["git stash save -u", "git stash save --include-untracked"] + "alternatives": ["git stash push -u", "git stash push --include-untracked"] }, { "title": "Saving current state with message", - "tip": "git stash save " + "tip": "git stash push -m ", + "alternatives": ["git stash push --message "] }, { "title": "Saving current state of all files (ignored, untracked, and tracked)", "tip": "git stash -a", - "alternatives": ["git stash --all", "git stash save --all"] + "alternatives": ["git stash --all", "git stash push --all"] }, { "title": "Show list of all saved stashes", "tip": "git stash list" From 4f15d65b68c149ba244dc6a83fd2155f3d91b148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ni=20Marvaud?= <24732919+lmarvaud@users.noreply.github.com> Date: Thu, 18 Mar 2021 15:54:42 +0100 Subject: [PATCH 244/251] Add tips to delete local branches that has been squash and merged in the remote --- README.md | 37 +++-- package-lock.json | 359 +++++++++++++++++++++++++++++++++++++++++++++- tips.json | 5 +- 3 files changed, 384 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4b9b20b..26dac9b 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,8 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master) * [Archive the `master` branch](#archive-the-master-branch) * [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message) -* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote) +* [Prunes references to remove branches that have been deleted in the remote.](#prunes-references-to-remove-branches-that-have-been-deleted-in-the-remote) +* [Delete local branches that has been squash and merged in the remote.](#delete-local-branches-that-has-been-squash-and-merged-in-the-remote) * [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision) * [Visualize the version tree.](#visualize-the-version-tree) * [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs) @@ -442,7 +443,7 @@ git stash __Alternatives:__ ```sh -git stash save +git stash push ``` ## Saving current state of unstaged changes to tracked files @@ -458,7 +459,7 @@ git stash --keep-index ```sh -git stash save --keep-index +git stash push --keep-index ``` ## Saving current state including untracked files @@ -469,17 +470,23 @@ git stash -u __Alternatives:__ ```sh -git stash save -u +git stash push -u ``` ```sh -git stash save --include-untracked +git stash push --include-untracked ``` ## Saving current state with message ```sh -git stash save +git stash push -m +``` + + +__Alternatives:__ +```sh +git stash push --message ``` ## Saving current state of all files (ignored, untracked, and tracked) @@ -495,7 +502,7 @@ git stash --all ```sh -git stash save --all +git stash push --all ``` ## Show list of all saved stashes @@ -645,7 +652,7 @@ git archive master --format=zip --output=master.zip git add --all && git commit --amend --no-edit ``` -## Prunes references to remote branches that have been deleted in the remote. +## Prunes references to remove branches that have been deleted in the remote. ```sh git fetch -p ``` @@ -656,6 +663,11 @@ __Alternatives:__ git remote prune origin ``` +## Delete local branches that has been squash and merged in the remote. +```sh +git branch -vv | grep ': gone]' | awk '{print }' | xargs git branch -D +``` + ## Retrieve the commit hash of the initial revision. ```sh git rev-list --reverse HEAD | head -1 @@ -1139,14 +1151,9 @@ git config [--global] --edit git blame -L , ``` -## List all Git variable. -```sh -git var -l -``` - -## Show a Git specific variable. +## Show a Git logical variable. ```sh -git var +git var -l | ``` ## Preformatted patch file. diff --git a/package-lock.json b/package-lock.json index 2ca1e1c..92e247e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,365 @@ { "name": "tips", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "doxie": "^0.2.2", + "doxie.append": "^0.1.0", + "doxie.inject": "^0.1.1", + "doxie.output": "^0.3.0", + "doxie.render": "^0.3.0", + "husky": "^0.8.1" + } + }, + "node_modules/1-liners": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/1-liners/-/1-liners-0.3.6.tgz", + "integrity": "sha1-SDD+eLdTejaZ+IpdQqjtwa9mB/8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/101": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/101/-/101-1.6.3.tgz", + "integrity": "sha512-4dmQ45yY0Dx24Qxp+zAsNLlMF6tteCyfVzgbulvSyC7tCyd3V8sW76sS0tHq8NpcbXfWTKasfyfzU1Kd86oKzw==", + "dev": true, + "dependencies": { + "clone": "^1.0.2", + "deep-eql": "^0.1.3", + "keypather": "^1.10.2" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "dev": true + }, + "node_modules/base64-js": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz", + "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q=", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/bops": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.6.tgz", + "integrity": "sha1-CC0dVfoB5g29wuvC26N/ZZVUzzo=", + "dev": true, + "dependencies": { + "base64-js": "0.0.2", + "to-utf8": "0.0.1" + } + }, + "node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/concat-stream": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.2.1.tgz", + "integrity": "sha1-81EAtsRjeL+6i2uA+fDQzN8T3GA=", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "dependencies": { + "bops": "0.0.6" + } + }, + "node_modules/deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "dependencies": { + "type-detect": "0.1.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "node_modules/doxie": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/doxie/-/doxie-0.2.4.tgz", + "integrity": "sha1-KZltv1dg/OdNvLTXnGAjHYoXu4U=", + "dev": true, + "dependencies": { + "1-liners": "^0.3.2", + "chalk": "^1.0.0", + "doxie-core": "^0.3.1", + "stream-to-json": "^0.0.1", + "tiny-error": "^0.2.1" + }, + "bin": { + "doxie": "bin/doxie.js" + } + }, + "node_modules/doxie-core": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/doxie-core/-/doxie-core-0.3.1.tgz", + "integrity": "sha1-PS+RQ+WF45Cpgwjcnk7zjxPPQss=", + "dev": true, + "dependencies": { + "1-liners": "^0.3.0", + "chalk": "^1.0.0", + "tiny-error": "^0.2.1" + } + }, + "node_modules/doxie.append": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/doxie.append/-/doxie.append-0.1.0.tgz", + "integrity": "sha1-yHRoUEL18wlKTQwzNsPklMNpdOE=", + "dev": true, + "dependencies": { + "object-assign": "^3.0.0" + } + }, + "node_modules/doxie.append/node_modules/object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/doxie.inject": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/doxie.inject/-/doxie.inject-0.1.1.tgz", + "integrity": "sha1-/QNYT4segOZEtcuUdpr+RH94oEc=", + "dev": true, + "dependencies": { + "1-liners": "^0.3.2", + "array-find": "^1.0.0", + "chalk": "^1.0.0", + "defined": "^1.0.0", + "object-assign": "^3.0.0", + "tiny-error": "^0.2.1" + } + }, + "node_modules/doxie.inject/node_modules/object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/doxie.output": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/doxie.output/-/doxie.output-0.3.0.tgz", + "integrity": "sha1-4H4Stn2qX8KLPsZn0HAv1ziZitE=", + "dev": true, + "dependencies": { + "1-liners": "^0.3.0", + "object-assign": "^3.0.0" + } + }, + "node_modules/doxie.output/node_modules/object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/doxie.render": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/doxie.render/-/doxie.render-0.3.2.tgz", + "integrity": "sha1-Mva37g88NSSokT08grn6uqoKGPA=", + "dev": true, + "dependencies": { + "1-liners": "^0.3.1", + "chalk": "^1.0.0", + "object-assign": "^3.0.0", + "tiny-error": "^0.2.1" + } + }, + "node_modules/doxie.render/node_modules/object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/husky": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.8.1.tgz", + "integrity": "sha1-7MeXuMTGiToz9IcDvJeppeUNhg8=", + "dev": true, + "hasInstallScript": true + }, + "node_modules/keypather": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/keypather/-/keypather-1.10.2.tgz", + "integrity": "sha1-4ESWMtSz5RbyHMAUznxWRP3c5hQ=", + "dev": true, + "dependencies": { + "101": "^1.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/stream-to-json": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/stream-to-json/-/stream-to-json-0.0.1.tgz", + "integrity": "sha1-8DDyt47TjkkpPbiFZTarzCZ3FHM=", + "dev": true, + "dependencies": { + "concat-stream": "~1.2.0", + "once": "~1.3.0" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/tiny-error": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tiny-error/-/tiny-error-0.2.3.tgz", + "integrity": "sha1-KHas/leFGwcUMTwVNd/HBgp8Cbs=", + "dev": true, + "dependencies": { + "101": "^1.0.0", + "object-assign": "^4.0.1" + } + }, + "node_modules/to-utf8": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz", + "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI=", + "dev": true + }, + "node_modules/type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + }, "dependencies": { "101": { "version": "1.6.3", diff --git a/tips.json b/tips.json index eea5b67..f823e40 100644 --- a/tips.json +++ b/tips.json @@ -216,9 +216,12 @@ "title": "Modify previous commit without modifying the commit message", "tip": "git add --all && git commit --amend --no-edit" }, { - "title": "Prunes references to remote branches that have been deleted in the remote.", + "title": "Prunes references to remove branches that have been deleted in the remote.", "tip": "git fetch -p", "alternatives": ["git remote prune origin"] + }, { + "title": "Delete local branches that has been squash and merged in the remote.", + "tip": "git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D" }, { "title": "Retrieve the commit hash of the initial revision.", "tip": " git rev-list --reverse HEAD | head -1", From ec4301cc2daa245b5a1d503ae9306704622ba910 Mon Sep 17 00:00:00 2001 From: Masahiko Shin Date: Tue, 4 May 2021 19:58:08 +0900 Subject: [PATCH 245/251] Add a tip to view what's in a stash --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 26dac9b..a04546a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Saving current state with message](#saving-current-state-with-message) * [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked) * [Show list of all saved stashes](#show-list-of-all-saved-stashes) +* [Show the contents of any stash in patch form](#show-the-contents-of-any-stash-in-patch-form) * [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list) * [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list) * [Delete all stored stashes](#delete-all-stored-stashes) @@ -510,6 +511,11 @@ git stash push --all git stash list ``` +## Show the contents of any stash in patch form +```sh +git stash show -p +``` + ## Apply any stash without deleting from the stashed list ```sh git stash apply diff --git a/tips.json b/tips.json index f823e40..4bf8c7d 100644 --- a/tips.json +++ b/tips.json @@ -152,6 +152,9 @@ "title": "Show list of all saved stashes", "tip": "git stash list" }, { + "title": "Show the contents of any stash in patch form", + "tip": "git stash show -p " + }, { "title": "Apply any stash without deleting from the stashed list", "tip": "git stash apply " }, { From c8eb026a8617d7b78d3b2a360959e0a0bb571bfd Mon Sep 17 00:00:00 2001 From: Masahiko Shin Date: Tue, 4 May 2021 19:30:37 +0900 Subject: [PATCH 246/251] Add a tip to omit writing branch names when push --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 26dac9b..2e6f300 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List all git aliases](#list-all-git-aliases) * [Show git status short](#show-git-status-short) * [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago) +* [Push the current branch to the same name on the remote repository](#push-the-current-branch-to-the-same-name-on-the-remote-repository) * [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track) * [Change a branch base](#change-a-branch-base) * [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes) @@ -1213,6 +1214,11 @@ git status --short --branch git checkout master@{yesterday} ``` +## Push the current branch to the same name on the remote repository +```sh +git push origin HEAD +``` + ## Push a new local branch to remote repository and track ```sh git push -u origin diff --git a/tips.json b/tips.json index f823e40..992d116 100644 --- a/tips.json +++ b/tips.json @@ -508,6 +508,9 @@ "title": "Checkout a commit prior to a day ago", "tip": "git checkout master@{yesterday}" }, { + "title": "Push the current branch to the same name on the remote repository", + "tip": "git push origin HEAD" + }, { "title": "Push a new local branch to remote repository and track", "tip": "git push -u origin " }, { From dc7a62b67d247eefd94a4f8abf5e7c95c5efc807 Mon Sep 17 00:00:00 2001 From: Itai Klapholtz Date: Tue, 4 May 2021 18:34:18 +0300 Subject: [PATCH 247/251] Add create local tag tip --- README.md | 6 ++++++ tips.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 26dac9b..b57c11a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Track upstream branch](#track-upstream-branch) * [Delete local branch](#delete-local-branch) * [Delete remote branch](#delete-remote-branch) +* [Create local tag](#create-local-tag) * [Delete local tag](#delete-local-tag) * [Delete remote tag](#delete-remote-tag) * [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head) @@ -316,6 +317,11 @@ git push origin : git branch -dr ``` +## Create local tag +```sh +git tag +``` + ## Delete local tag ```sh git tag -d diff --git a/tips.json b/tips.json index f823e40..217c960 100644 --- a/tips.json +++ b/tips.json @@ -65,6 +65,9 @@ "title": "Delete remote branch", "tip": "git push origin --delete ", "alternatives": ["git push origin :", "git branch -dr "] + }, { + "title": "Create local tag", + "tip": "git tag " }, { "title": "Delete local tag", "tip": "git tag -d " From 1c37e6b3eba09f3839fef75e31ba9170a096470f Mon Sep 17 00:00:00 2001 From: Mohammad Javad Nikbakht <37978546+javadnikbakht@users.noreply.github.com> Date: Fri, 13 Aug 2021 02:48:19 +0430 Subject: [PATCH 248/251] A Persian version of README file link Added --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71e3718..23f936d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## git-tips > Collection of `git-tips`, want to add your tips? Checkout [contributing.md](./contributing.md) -[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) | [Polski](https://github.com/mbiesiad/tips) +[English](http://git.io/git-tips) | [中文](https://github.com/521xueweihan/git-tips) | [Русский](https://github.com/Imangazaliev/git-tips) | [한국어](https://github.com/mingrammer/git-tips) | [Tiếng Việt](https://github.com/hprobotic/git-tips) | [日本語](https://github.com/isotai/git-tips) | [नेपाली](https://github.com/amarduwal/git-tips) | [Polski](https://github.com/mbiesiad/tips) | [فارسی](https://github.com/javadnikbakht/git-tips) ### __Tools:__ From a8f70a05dc8bc5870b3a92f7e2f35c5c79b52cbc Mon Sep 17 00:00:00 2001 From: Arnab Nandy Date: Thu, 6 Apr 2023 10:41:48 +0530 Subject: [PATCH 249/251] Fix:git checkout -- is incorrect #177 --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 23f936d..757ef31 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ git tag -d git push origin :refs/tags/ ``` -## Undo local changes with the last content in head +## Undo local changes with the content in index(staging) ```sh git checkout -- ``` diff --git a/tips.json b/tips.json index 5c38a63..d53d1ae 100644 --- a/tips.json +++ b/tips.json @@ -75,7 +75,7 @@ "title": "Delete remote tag", "tip": "git push origin :refs/tags/" }, { - "title": "Undo local changes with the last content in head", + "title": "Undo local changes with the content in index(staging)", "tip": "git checkout -- " }, { "title": "Revert: Undo a commit by creating a new commit", From a67bf7c06eb76de096a9cbbffac9cb13e851f26b Mon Sep 17 00:00:00 2001 From: Arnab Nandy Date: Thu, 6 Apr 2023 10:56:32 +0530 Subject: [PATCH 250/251] adding the package files --- package-lock.json | 365 +--------------------------------------------- package.json | 2 +- 2 files changed, 5 insertions(+), 362 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92e247e..ec93f7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,365 +1,8 @@ { "name": "tips", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "version": "1.0.0", - "license": "MIT", - "devDependencies": { - "doxie": "^0.2.2", - "doxie.append": "^0.1.0", - "doxie.inject": "^0.1.1", - "doxie.output": "^0.3.0", - "doxie.render": "^0.3.0", - "husky": "^0.8.1" - } - }, - "node_modules/1-liners": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/1-liners/-/1-liners-0.3.6.tgz", - "integrity": "sha1-SDD+eLdTejaZ+IpdQqjtwa9mB/8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/101": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/101/-/101-1.6.3.tgz", - "integrity": "sha512-4dmQ45yY0Dx24Qxp+zAsNLlMF6tteCyfVzgbulvSyC7tCyd3V8sW76sS0tHq8NpcbXfWTKasfyfzU1Kd86oKzw==", - "dev": true, - "dependencies": { - "clone": "^1.0.2", - "deep-eql": "^0.1.3", - "keypather": "^1.10.2" - } - }, - "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-find": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", - "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", - "dev": true - }, - "node_modules/base64-js": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz", - "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/bops": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.6.tgz", - "integrity": "sha1-CC0dVfoB5g29wuvC26N/ZZVUzzo=", - "dev": true, - "dependencies": { - "base64-js": "0.0.2", - "to-utf8": "0.0.1" - } - }, - "node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/concat-stream": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.2.1.tgz", - "integrity": "sha1-81EAtsRjeL+6i2uA+fDQzN8T3GA=", - "dev": true, - "engines": [ - "node >= 0.8.0" - ], - "dependencies": { - "bops": "0.0.6" - } - }, - "node_modules/deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", - "dev": true, - "dependencies": { - "type-detect": "0.1.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "node_modules/doxie": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/doxie/-/doxie-0.2.4.tgz", - "integrity": "sha1-KZltv1dg/OdNvLTXnGAjHYoXu4U=", - "dev": true, - "dependencies": { - "1-liners": "^0.3.2", - "chalk": "^1.0.0", - "doxie-core": "^0.3.1", - "stream-to-json": "^0.0.1", - "tiny-error": "^0.2.1" - }, - "bin": { - "doxie": "bin/doxie.js" - } - }, - "node_modules/doxie-core": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/doxie-core/-/doxie-core-0.3.1.tgz", - "integrity": "sha1-PS+RQ+WF45Cpgwjcnk7zjxPPQss=", - "dev": true, - "dependencies": { - "1-liners": "^0.3.0", - "chalk": "^1.0.0", - "tiny-error": "^0.2.1" - } - }, - "node_modules/doxie.append": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/doxie.append/-/doxie.append-0.1.0.tgz", - "integrity": "sha1-yHRoUEL18wlKTQwzNsPklMNpdOE=", - "dev": true, - "dependencies": { - "object-assign": "^3.0.0" - } - }, - "node_modules/doxie.append/node_modules/object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/doxie.inject": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/doxie.inject/-/doxie.inject-0.1.1.tgz", - "integrity": "sha1-/QNYT4segOZEtcuUdpr+RH94oEc=", - "dev": true, - "dependencies": { - "1-liners": "^0.3.2", - "array-find": "^1.0.0", - "chalk": "^1.0.0", - "defined": "^1.0.0", - "object-assign": "^3.0.0", - "tiny-error": "^0.2.1" - } - }, - "node_modules/doxie.inject/node_modules/object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/doxie.output": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/doxie.output/-/doxie.output-0.3.0.tgz", - "integrity": "sha1-4H4Stn2qX8KLPsZn0HAv1ziZitE=", - "dev": true, - "dependencies": { - "1-liners": "^0.3.0", - "object-assign": "^3.0.0" - } - }, - "node_modules/doxie.output/node_modules/object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/doxie.render": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/doxie.render/-/doxie.render-0.3.2.tgz", - "integrity": "sha1-Mva37g88NSSokT08grn6uqoKGPA=", - "dev": true, - "dependencies": { - "1-liners": "^0.3.1", - "chalk": "^1.0.0", - "object-assign": "^3.0.0", - "tiny-error": "^0.2.1" - } - }, - "node_modules/doxie.render/node_modules/object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/husky": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-0.8.1.tgz", - "integrity": "sha1-7MeXuMTGiToz9IcDvJeppeUNhg8=", - "dev": true, - "hasInstallScript": true - }, - "node_modules/keypather": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/keypather/-/keypather-1.10.2.tgz", - "integrity": "sha1-4ESWMtSz5RbyHMAUznxWRP3c5hQ=", - "dev": true, - "dependencies": { - "101": "^1.0.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/stream-to-json": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/stream-to-json/-/stream-to-json-0.0.1.tgz", - "integrity": "sha1-8DDyt47TjkkpPbiFZTarzCZ3FHM=", - "dev": true, - "dependencies": { - "concat-stream": "~1.2.0", - "once": "~1.3.0" - } - }, - "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/tiny-error": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tiny-error/-/tiny-error-0.2.3.tgz", - "integrity": "sha1-KHas/leFGwcUMTwVNd/HBgp8Cbs=", - "dev": true, - "dependencies": { - "101": "^1.0.0", - "object-assign": "^4.0.1" - } - }, - "node_modules/to-utf8": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz", - "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI=", - "dev": true - }, - "node_modules/type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - } - }, "dependencies": { "101": { "version": "1.6.3", @@ -572,9 +215,9 @@ } }, "husky": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-0.8.1.tgz", - "integrity": "sha1-7MeXuMTGiToz9IcDvJeppeUNhg8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-5.2.0.tgz", + "integrity": "sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg==", "dev": true }, "keypather": { diff --git a/package.json b/package.json index 6d1b215..75efa09 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,6 @@ "doxie.inject": "^0.1.1", "doxie.output": "^0.3.0", "doxie.render": "^0.3.0", - "husky": "^0.8.1" + "husky": "^5.0.9" } } From 07662dbac1348b9f6ee9c1d28f03e8bcb930db4a Mon Sep 17 00:00:00 2001 From: Bob Conan Date: Wed, 23 Oct 2024 15:11:22 -0500 Subject: [PATCH 251/251] Update tips.json, fix a typo --- tips.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips.json b/tips.json index d53d1ae..7cf20b2 100644 --- a/tips.json +++ b/tips.json @@ -132,7 +132,7 @@ "title": "Git Aliases", "tip": "git config --global alias. \ngit config --global alias.st status" }, { - "title": "Saving current state of tracked files without commiting", + "title": "Saving current state of tracked files without committing", "tip": "git stash", "alternatives": ["git stash push"] }, {