├── .gitignore ├── .travis.yml ├── Images ├── git-tip.gif └── git-tip.png ├── LICENSE ├── README.md ├── index.js ├── index.test.js ├── package.json └── tips.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | node_modules/ 3 | npm-debug.log.* 4 | coverage 5 | npm-debug.log 6 | *~ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | cache: 4 | directories: 5 | - node_modules 6 | notifications: 7 | email: false 8 | node_js: 9 | - '5' 10 | before_install: 11 | - npm i -g npm@^2.0.0 12 | before_script: 13 | - npm prune 14 | script: 15 | - npm run update-tips 16 | - npm run test 17 | after_success: 18 | branches: 19 | except: 20 | - /^v\d+\.\d+\.\d+$/ -------------------------------------------------------------------------------- /Images/git-tip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nirajpandkar/git-tip/32fa1d5574e9b0f33c03d89ad92356d08c25e939/Images/git-tip.gif -------------------------------------------------------------------------------- /Images/git-tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nirajpandkar/git-tip/32fa1d5574e9b0f33c03d89ad92356d08c25e939/Images/git-tip.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Niraj Pandkar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # git-tip [![Build Status](https://travis-ci.org/nirajpandkar/git-tip.svg?branch=master)](https://travis-ci.org/nirajpandkar/git-tip) 2 | 3 | > CLI that gives a random git-tip. 4 | 5 | The git-tips [JSON file](https://github.com/git-tips/tips/blob/master/tips.json) is taken from this awesome project - [git-tips](https://github.com/git-tips/tips) 6 | Any suggestion/criticism/PRs are welcome :) 7 | 8 | ![alt text](Images/git-tip.gif "git-tip gif") 9 | 10 | ## `wget` dependency for Windows and Mac Users 11 | 12 | ### Mac 13 | 14 | ``` 15 | $ brew install wget 16 | ``` 17 | 18 | ### Windows 19 | 20 | [Download and install wget](http://gnuwin32.sourceforge.net/packages/wget.htm) 21 | 22 | ## Install 23 | 24 | ``` 25 | $ npm install --global git-tip 26 | ``` 27 | 28 | ### Script to greet yourself with a git-tip every time a new terminal opens 29 | 30 | ``` 31 | which git-tip >> ~/.bashrc 32 | ``` 33 | 34 | ## Usage 35 | 36 | ``` 37 | Usage 38 | $ git-tip [options] 39 | Options 40 | --help Provides usage help (Shows the current page) 41 | --all Gives all the git tips 42 | Gives the git tips consisting of the keyword 43 | Examples 44 | $ git-tip bypass 45 | 46 | 1. Bypass pre-commit and commit-msg githooks 47 | => git commit --no-verify 48 | 49 | $ git-tip 50 | 51 | Git Tip of the Terminal 52 | ------------------------- 53 | Saving current state of tracked files without commiting 54 | => git stash 55 | ``` 56 | 57 | ## Todo 58 | 59 | - [x] Basic Functionality 60 | - [x] Help page 61 | - [x] Add continuous integration(Travis CI) 62 | - [x] Add tests 63 | - [ ] Add more relevant tests to increase code coverage 64 | - [x] Code coverage 65 | - [ ] Add code coverage reports 66 | - [x] Script to automatically update tips.json file when installing globally from npm 67 | - [x] Script to execute `git-tip` every time a new terminal opens 68 | - [x] Add `wget`'s necessity before installation in the README. 69 | 70 | ## License 71 | MIT © [Niraj Pandkar](https://github.com/nirajpandkar) 72 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk'); 3 | const tips = require('./tips.json'); 4 | const uniqueRandomArray = require('unique-random-array'); 5 | const meow = require('meow'); 6 | 7 | module.exports={ 8 | random:randomTip, 9 | all:allTips, 10 | keyword:keywordTips 11 | }; 12 | 13 | function randomTip(){ 14 | var arrayOfTips = uniqueRandomArray(tips); //returns a function 15 | return arrayOfTips(); //returns a random object(title,tip) from tips.json 16 | } 17 | 18 | function keywordTips(inputKeyword){ 19 | var arr = []; 20 | for(var i=0;i Gives the git tips consisting of the keyword ' + 39 | '\n Examples ' + 40 | '\n $ git-tip bypass ' + 41 | '\n 1. Bypass pre-commit and commit-msg githooks ' + 42 | '\n => git commit --no-verify ' + 43 | '\n $ git-tip ' + 44 | '\n Git Tip of the Terminal ' + 45 | '\n ------------------------- ' + 46 | '\n Saving current state of tracked files without commiting ' + 47 | '\n => git stash '); 48 | 49 | 50 | 51 | if(cli.input[0]!=undefined){ 52 | inputKeyword = cli.input[0].toLowerCase(); //the command line argument 53 | var keywordtips = keywordTips(inputKeyword); 54 | for(var i=0;i "+chalk.bold.green(keywordtips[i].tip+"\n")); 57 | } 58 | 59 | } 60 | else if(cli.flags.all){ 61 | var alltips = allTips(); 62 | for(i=0;i "+alltips[i].tip+"\n")); 65 | } 66 | } 67 | else if(cli.input[0]==undefined){ 68 | tip = randomTip(); 69 | console.log(chalk.bold.yellow(" Git Tip of the Terminal ")); 70 | console.log(chalk.bold.yellow("-------------------------")); 71 | console.log(chalk.bold.cyan(tip.title)); 72 | console.log(chalk.bold.green("=> "+tip.tip)); 73 | } 74 | -------------------------------------------------------------------------------- /index.test.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var expect = chai.expect; 3 | var gittip = require("./index"); 4 | var tips = require("./tips.json"); 5 | 6 | describe("git-tip",function(){ 7 | describe("randomTip",function(){ 8 | it("should return an object with tip(git command) and title",function(){ 9 | var randomTip =gittip.random(); 10 | expect(randomTip).to.be.an('object'); 11 | }); 12 | it("should return an object from available tips.json",function(){ 13 | var randomTip =gittip.random(); 14 | expect(tips).to.include(randomTip); 15 | }); 16 | }); 17 | 18 | describe("allTips",function(){ 19 | it("should return all the tips",function(){ 20 | var allTips = gittip.all(); 21 | for(var i=0;i", 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/nirajpandkar/random-git-tip/issues" 28 | }, 29 | "homepage": "https://github.com/nirajpandkar/random-git-tip#readme", 30 | "dependencies": { 31 | "chalk": "1.1.3", 32 | "meow": "3.7.0", 33 | "unique-random-array": "1.0.0" 34 | }, 35 | "devDependencies": { 36 | "chai": "3.5.0", 37 | "commitizen": "2.8.5", 38 | "cz-conventional-changelog": "1.1.6", 39 | "ghooks": "1.3.2", 40 | "istanbul": "0.4.4", 41 | "mocha": "3.0.1" 42 | }, 43 | "czConfig": { 44 | "path": "node_modules/cz-conventional-changelog" 45 | }, 46 | "config": { 47 | "ghooks": { 48 | "pre-commit": "npm run test" 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /tips.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "title": "Everyday Git in twenty commands or so", 3 | "tip": "git help everyday" 4 | }, { 5 | "title": "Show helpful guides that come with Git", 6 | "tip": "git help -g" 7 | }, { 8 | "title": "Overwrite pull", 9 | "tip": "git fetch --all && git reset --hard origin/master" 10 | }, { 11 | "title": "List of all files till a commit", 12 | "tip": "git ls-tree --name-only -r " 13 | }, { 14 | "title": "Git reset first commit", 15 | "tip": "git update-ref -d HEAD" 16 | }, { 17 | "title": "List all the conflicted files", 18 | "tip": "git diff --name-only --diff-filter=U" 19 | }, { 20 | "title": "List of all files changed in a commit", 21 | "tip": "git diff-tree --no-commit-id --name-only -r " 22 | }, { 23 | "title": "Unstaged changes since last commit", 24 | "tip": "git diff" 25 | }, { 26 | "title": "Changes staged for commit", 27 | "tip": "git diff --cached", 28 | "alternatives": ["git diff --staged"] 29 | }, { 30 | "title": "Show both staged and unstaged changes", 31 | "tip": "git diff HEAD" 32 | }, { 33 | "title": "List all branches that are already merged into master", 34 | "tip": "git branch --merged master" 35 | }, { 36 | "title": "Quickly switch to the previous branch", 37 | "tip": "git checkout -" 38 | }, { 39 | "title": "Remove branches that have already been merged with master", 40 | "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", 41 | "alternatives": ["git branch --merged master | grep -v '^\\*\\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out"] 42 | }, { 43 | "title": "List all branches and their upstreams, as well as last commit on branch", 44 | "tip": "git branch -vv" 45 | }, { 46 | "title": "Track upstream branch", 47 | "tip": "git branch -u origin/mybranch" 48 | }, { 49 | "title": "Delete local branch", 50 | "tip": "git branch -d " 51 | }, { 52 | "title": "Delete remote branch", 53 | "tip": "git push origin --delete ", 54 | "alternatives": ["git push origin :"] 55 | }, { 56 | "title": "Delete local tag", 57 | "tip": "git tag -d " 58 | }, { 59 | "title": "Delete remote tag", 60 | "tip": "git push origin :refs/tags/" 61 | }, { 62 | "title": "Undo local changes with the last content in head", 63 | "tip": "git checkout -- " 64 | }, { 65 | "title": "Revert: Undo a commit by creating a new commit", 66 | "tip": "git revert " 67 | }, { 68 | "title": "Reset: Discard commits, advised for private branch", 69 | "tip": "git reset " 70 | }, { 71 | "title": "Reword the previous commit message", 72 | "tip": "git commit -v --amend" 73 | }, { 74 | "title": "See commit history for just the current branch", 75 | "tip": "git cherry -v master" 76 | }, { 77 | "title": "Amend author.", 78 | "tip": "git commit --amend --author='Author Name '" 79 | }, { 80 | "title": "Reset author, after author has been changed in the global config.", 81 | "tip": "git commit --amend --reset-author --no-edit" 82 | }, { 83 | "title": "Changing a remote's URL", 84 | "tip": "git remote set-url origin " 85 | }, { 86 | "title": "Get list of all remote references", 87 | "tip": "git remote", 88 | "alternatives": ["git remote show"] 89 | }, { 90 | "title": "Get list of all local and remote branches", 91 | "tip": "git branch -a" 92 | }, { 93 | "title": "Get only remote branches", 94 | "tip": "git branch -r" 95 | }, { 96 | "title": "Stage parts of a changed file, instead of the entire file", 97 | "tip": "git add -p" 98 | }, { 99 | "title": "Get git bash completion", 100 | "tip": "curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc" 101 | }, { 102 | "title": "What changed since two weeks?", 103 | "tip": "git log --no-merges --raw --since='2 weeks ago'", 104 | "alternatives": ["git whatchanged --since='2 weeks ago'"] 105 | }, { 106 | "title": "See all commits made since forking from master", 107 | "tip": "git log --no-merges --stat --reverse master.." 108 | }, { 109 | "title": "Pick commits across branches using cherry-pick", 110 | "tip": "git checkout && git cherry-pick " 111 | }, { 112 | "title": "Find out branches containing commit-hash", 113 | "tip": "git branch -a --contains ", 114 | "alternatives": ["git branch --contains "] 115 | }, { 116 | "title": "Git Aliases", 117 | "tip": "git config --global alias. \ngit config --global alias.st status" 118 | }, { 119 | "title": "Saving current state of tracked files without commiting", 120 | "tip": "git stash", 121 | "alternatives": ["git stash save"] 122 | }, { 123 | "title": "Saving current state including untracked files", 124 | "tip": "git stash save -u", 125 | "alternatives": ["git stash save --include-untracked"] 126 | }, { 127 | "title": "Show list of all saved stashes", 128 | "tip": "git stash list" 129 | }, { 130 | "title": "Apply any stash without deleting from the stashed list", 131 | "tip": "git stash apply " 132 | }, { 133 | "title": "Apply last stashed state and delete it from stashed list", 134 | "tip": "git stash pop", 135 | "alternatives": ["git stash apply stash@{0} && git stash drop stash@{0}"] 136 | }, { 137 | "title": "Delete all stored stashes", 138 | "tip": "git stash clear", 139 | "alternatives": ["git stash drop "] 140 | }, { 141 | "title": "Grab a single file from a stash", 142 | "tip": "git checkout -- ", 143 | "alternatives": ["git checkout stash@{0} -- "] 144 | }, { 145 | "title": "Show all tracked files", 146 | "tip": "git ls-files -t" 147 | }, { 148 | "title": "Show all untracked files", 149 | "tip": "git ls-files --others" 150 | }, { 151 | "title": "Show all ignored files", 152 | "tip": "git ls-files --others -i --exclude-standard" 153 | }, { 154 | "title": "Create new working tree from a repository (git 2.5)", 155 | "tip": "git worktree add -b " 156 | }, { 157 | "title": "Create new working tree from HEAD state", 158 | "tip": "git worktree add --detach HEAD" 159 | }, { 160 | "title": "Untrack files without deleting", 161 | "tip": "git rm --cached ", 162 | "alternatives": ["git rm --cached -r "] 163 | }, { 164 | "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", 165 | "tip": "git clean -n" 166 | }, { 167 | "title": "Forcefully remove untracked files", 168 | "tip": "git clean -f" 169 | }, { 170 | "title": "Forcefully remove untracked directory", 171 | "tip": "git clean -f -d", 172 | "alternatives": ["git clean -df"] 173 | }, { 174 | "title": "Update all the submodules", 175 | "tip": "git submodule foreach git pull", 176 | "alternatives": ["git submodule update --init --recursive", "git submodule update --remote"] 177 | }, { 178 | "title": "Show all commits in the current branch yet to be merged to master", 179 | "tip": "git cherry -v master", 180 | "alternatives": ["git cherry -v master "] 181 | }, { 182 | "title": "Rename a branch", 183 | "tip": "git branch -m ", 184 | "alternatives": ["git branch -m [] "] 185 | }, { 186 | "title": "Rebases 'feature' to 'master' and merges it in to master ", 187 | "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" 188 | }, { 189 | "title": "Archive the `master` branch", 190 | "tip": "git archive master --format=zip --output=master.zip" 191 | }, { 192 | "title": "Modify previous commit without modifying the commit message", 193 | "tip": "git add --all && git commit --amend --no-edit" 194 | }, { 195 | "title": "Prunes references to remote branches that have been deleted in the remote.", 196 | "tip": "git fetch -p", 197 | "alternatives": ["git remote prune origin"] 198 | }, { 199 | "title": "Retrieve the commit hash of the initial revision.", 200 | "tip": " git rev-list --reverse HEAD | head -1", 201 | "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"] 202 | }, { 203 | "title": "Visualize the version tree.", 204 | "tip": "git log --pretty=oneline --graph --decorate --all", 205 | "alternatives": ["gitk --all"] 206 | }, { 207 | "title": "Deploying git tracked subfolder to gh-pages", 208 | "tip": "git subtree push --prefix subfolder_name origin gh-pages", 209 | "alternatives": "git subtree push --prefix subfolder_name origin branch_name" 210 | }, { 211 | "title": "Adding a project to repo using subtree", 212 | "tip": "git subtree add --prefix=/ --squash git@github.com:/.git master" 213 | }, { 214 | "title": "Get latest changes in your repo for a linked project using subtree", 215 | "tip": "git subtree pull --prefix=/ --squash git@github.com:/.git master" 216 | }, { 217 | "title": "Export a branch with history to a file.", 218 | "tip": "git bundle create " 219 | }, { 220 | "title": "Import from a bundle", 221 | "tip": "git clone repo.bundle -b " 222 | }, { 223 | "title": "Get the name of current branch.", 224 | "tip": "git rev-parse --abbrev-ref HEAD" 225 | }, { 226 | "title": "Ignore one file on commit (e.g. Changelog).", 227 | "tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog" 228 | }, { 229 | "title": "Stash changes before rebasing", 230 | "tip": "git rebase --autostash" 231 | }, { 232 | "title": "Fetch pull request by ID to a local branch", 233 | "tip": "git fetch origin pull//head:", 234 | "alternatives": ["git pull origin pull//head:"] 235 | }, { 236 | "title": "Show the most recent tag on the current branch.", 237 | "tip": "git describe --tags --abbrev=0" 238 | }, { 239 | "title": "Show inline word diff.", 240 | "tip": "git diff --word-diff" 241 | }, { 242 | "title": "Show changes using common diff tools.", 243 | "tip": "git difftool -t " 244 | }, { 245 | "title": "Don’t consider changes for tracked file.", 246 | "tip": "git update-index --assume-unchanged " 247 | }, { 248 | "title": "Undo assume-unchanged.", 249 | "tip": "git update-index --no-assume-unchanged " 250 | }, { 251 | "title": "Clean the files from `.gitignore`.", 252 | "tip": "git clean -X -f" 253 | }, { 254 | "title": "Restore deleted file.", 255 | "tip": "git checkout ^ -- " 256 | }, { 257 | "title": "Restore file to a specific commit-hash", 258 | "tip": "git checkout -- " 259 | }, { 260 | "title": "Always rebase instead of merge on pull.", 261 | "tip": "git config --global branch.autosetuprebase always" 262 | }, { 263 | "title": "List all the alias and configs.", 264 | "tip": "git config --list" 265 | }, { 266 | "title": "Make git case sensitive.", 267 | "tip": "git config --global core.ignorecase false" 268 | },{ 269 | "title": "Add custom editors.", 270 | "tip": "git config --global core.editor '$EDITOR'" 271 | }, { 272 | "title": "Auto correct typos.", 273 | "tip": "git config --global help.autocorrect 1" 274 | }, { 275 | "title": "Check if the change was a part of a release.", 276 | "tip": "git name-rev --name-only " 277 | }, { 278 | "title": "Dry run. (any command that supports dry-run flag should do.)", 279 | "tip": "git clean -fd --dry-run" 280 | }, { 281 | "title": "Marks your commit as a fix of a previous commit.", 282 | "tip": "git commit --fixup " 283 | }, { 284 | "title": "Squash fixup commits normal commits.", 285 | "tip": "git rebase -i --autosquash" 286 | }, { 287 | "title": "Skip staging area during commit.", 288 | "tip": "git commit --only " 289 | }, { 290 | "title": "Interactive staging.", 291 | "tip": "git add -i" 292 | }, { 293 | "title": "List ignored files.", 294 | "tip": "git check-ignore *" 295 | }, { 296 | "title": "Status of ignored files.", 297 | "tip": "git status --ignored" 298 | }, { 299 | "title": "Commits in Branch1 that are not in Branch2", 300 | "tip": "git log Branch1 ^Branch2" 301 | }, { 302 | "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", 303 | "tip": "git config --global rerere.enabled 1" 304 | }, { 305 | "title": "Open all conflicted files in an editor.", 306 | "tip": "git diff --name-only | uniq | xargs $EDITOR" 307 | }, { 308 | "title": "Count unpacked number of objects and their disk consumption.", 309 | "tip": "git count-objects --human-readable" 310 | }, { 311 | "title": "Prune all unreachable objects from the object database.", 312 | "tip": "git gc --prune=now --aggressive" 313 | }, { 314 | "title": "Instantly browse your working repository in gitweb.", 315 | "tip": "git instaweb [--local] [--httpd=] [--port=] [--browser=]" 316 | }, { 317 | "title": "View the GPG signatures in the commit log", 318 | "tip": "git log --show-signature" 319 | }, { 320 | "title": "Remove entry in the global config.", 321 | "tip": "git config --global --unset " 322 | }, { 323 | "title": "Checkout a new branch without any history", 324 | "tip": "git checkout --orphan " 325 | }, { 326 | "title": "Extract file from another branch.", 327 | "tip": "git show :" 328 | }, { 329 | "title": "List only the root and merge commits.", 330 | "tip": "git log --first-parent" 331 | }, { 332 | "title": "Change previous two commits with an interactive rebase.", 333 | "tip": "git rebase --interactive HEAD~2" 334 | }, { 335 | "title": "List all branch is WIP", 336 | "tip": "git checkout master && git branch --no-merged" 337 | }, { 338 | "title": "Find guilty with binary search", 339 | "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" 340 | }, { 341 | "title": "Bypass pre-commit and commit-msg githooks", 342 | "tip": "git commit --no-verify" 343 | }, { 344 | "title": "List commits and changes to a specific file (even through renaming)", 345 | "tip": "git log --follow -p -- " 346 | },{ 347 | "title": "Clone a single branch", 348 | "tip": "git clone -b --single-branch https://github.com/user/repo.git" 349 | },{ 350 | "title": "Create and switch new branch", 351 | "tip": "git checkout -b ", 352 | "alternatives": ["git branch && git checkout "] 353 | },{ 354 | "title": "Ignore file mode changes on commits", 355 | "tip": "git config core.fileMode false" 356 | },{ 357 | "title": "Turn off git colored terminal output", 358 | "tip": "git config --global color.ui false" 359 | },{ 360 | "title": "Specific color settings", 361 | "tip": "git config --global " 362 | },{ 363 | "title": "Show all local branches ordered by recent commits", 364 | "tip": "git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/" 365 | },{ 366 | "title": "Find lines matching the pattern (regex or string) in tracked files", 367 | "tip": "git grep --heading --line-number 'foo bar'" 368 | }, { 369 | "title": "Clone a shallow copy of a repository", 370 | "tip": "git clone https://github.com/user/repo.git --depth 1" 371 | }, { 372 | "title": "Search Commit log across all branches for given text", 373 | "tip": "git log --all --grep=''" 374 | }, { 375 | "title": "Get first commit in a branch (from master)", 376 | "tip": "git log master.. --oneline | tail -1" 377 | }, { 378 | "title": "Unstaging Staged file", 379 | "tip": "git reset HEAD " 380 | }, { 381 | "title": "Force push to Remote Repository", 382 | "tip": "git push -f " 383 | }, { 384 | "title": "Adding Remote name", 385 | "tip": "git remote add " 386 | }, { 387 | "title": "Show the author, time and last revision made to each line of a given file", 388 | "tip": "git blame " 389 | }, { 390 | "title": "Group commits by authors and title", 391 | "tip": "git shortlog" 392 | }] 393 | --------------------------------------------------------------------------------