Category Archives: git

GIT: conflict resolve on pull or merge

Theirs on top git pull -s recursive -X theirs <remote> <branch> git merge -s recursive -X theirs <branch> My on top git pull -s recursive -X ours <remote> <branch> git merge -s recursive -X ours <branch>

Posted in git | Leave a comment

git: file history with diff

Show diff ONLY for src/main/resources/file.xml git log -p src/main/resources/file.xml Show diff for ALL FILES that touches src/main/resources/file.xml git log -p –full-diff src/main/resources/file.xml

Posted in git | Leave a comment

Git tags

Tags git tag -a v1.0 -m ‘version 1.0′ # add tag git tag -d v1.0 # remove tag git push origin :refs/tags/v1.0 # remove remote tag

Posted in git | Leave a comment

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://" } } more info here

Also posted in github, node.js, npm | Leave a comment

Git usable commands

Delete remote and local branch git push origin :branch-to-delete git branch -d branch-to-delete Join/merge last X (in example below 3) commits into one git 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 1 In next editor edit final [...]

Posted in git | Tagged , , , , | Leave a comment