Change commit date

$ git rebase -i HEAD~3   In editor mark commit that need change as ‘edit’ (the second commit in example below)   pick 64b0966 commit message 1… edit 07f540b commit message 2… pick a2b69e4 commit message 3…   # Rebase 50d9975..a2b69e4 onto 50d9975 (3 command(s)) # # Commands: # p, pick = use commit # Read more about Change commit date[…]

Posted in git

git: file history with diff

Show diff ONLY for src/main/resources/file.xmlgit log -p src/main/resources/file.xml Show diff for ALL FILES that touches src/main/resources/file.xmlgit log -p –full-diff src/main/resources/file.xml Show diff but with 0 context lines (no context lines) git log -p -U0 Similar like above, but diff in history git diff -U0

git (github) repository as npm dependency

{ "name": "node-sample-app", "version": "0.0.1", "private": true, "scripts": { "start": "node app.js" }, "dependencies": { "private-module1": "git+", "private-module2": "git+ssh://" } }{ "name": "node-sample-app", "version": "0.0.1", "private": true, "scripts": { "start": "node app.js" }, "dependencies": { "private-module1": "git+", "private-module2": "git+ssh://" } } more info here

Git usable commands

Delete branchesgit branch -d branch-name # delete local branchgit push origin :branch-name # delete remote branch Rename local branchgit branch -m old-branch new-branch Join/merge last X (in example below 3) commits into onegit rebase -i HEAD~3 In editor (pick last, squash 2 earlier commits):pick 7e168d2 commit message 3 s b3bd215 commit message 2 s 436052d commit message Read more about Git usable commands[…]