Skip to content

Instantly share code, notes, and snippets.

@alexandervantrijffel
Last active August 8, 2018 15:53
Show Gist options
  • Save alexandervantrijffel/c5a2eceaa9dc8e01323d8fcdc97f3c4e to your computer and use it in GitHub Desktop.
Save alexandervantrijffel/c5a2eceaa9dc8e01323d8fcdc97f3c4e to your computer and use it in GitHub Desktop.
# find files of extension .go on mac os
git ls-files -- "*.go"
# diff between commits with meld
git difftool 47981fcf..49128f10 -d
# diff between branches with meld
git difftool -d OTHERBRANCH
$ git commit --fixup=a0b1c2d3 # Perform the commit to fix broken a0b1c2d3
$ git rebase -i --autosquash a0b1c2d3~1 # Now merge fixup commit into broken commit
# delete server branch
git push origin --delete <branch_name>
# rebase / squash:
git checkout feature_branch
git rebase master
git checkout master
git merge --squash feature_branch
git log --graph --oneline DDTP-1109 master
git rebase --abort
republish (delete remote branch, push with force)
total number of line changes between two commits:
git diff --stat
eerdere versie van bestand bekijken:
git show HEAD~1:src/Transformations.Domain.MessageHandlers.Test/when_sending_create_and_schedule_transformation_command.cs
es-cli projections new
git diff 12aa12^! diff voor commit 12aa12
git diff HEAD~5..HEAD diff voor laatste 5 commits
git diff DDTP-736 remotes/origin/DDTP-736 vergelijk huidige branch vs remote
git log origin/master..HEAD --oneline vergelijk huidige branch vs master
git remote update origin --prune werk lijst van remote branches bij
git stash --keep-index stash everything not added yet
git remote show origin
git show toon laatste commits met diff
git squash, local commit work in progress\
undo local commit and put changes in staged
git reset --soft HEAD^
delete remote branch
git push origin :serverfix
other machines:
git fetch --all --prune
paden vinden:
git ls-files -- '**/MyFile*'
dan gebruiken in git blame b.v.
Git blame tot aan commit 11aaa11
git blame 11aaa11^ -- src/options.cpp
view log for specific file
git log --follow filename
view changes of specific file
git log -p filename
git log --full-diff --max-count=5
git log HEAD..FETCH_HEAD --max-count=5 --oneline --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset'
git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset'
git branch -a
git branch -r
shell:startup
git config --global log.decorate true
git config --global log.abbrevCommit true
CTRL+K, CTRL+D format document
git diff -- */models.py wildcard search
git config --global core.autocrlf true
Delete the most recent commit, keeping the work you've done:
git reset --soft HEAD~1
Delete the most recent commit, destroying the work you've done:
git reset --hard HEAD~1
git diff master origin/master
git checkout - # checkout last branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment