- Mark Dominus
- Bert Belder, Checkout github pull requests locally
- Chris Wanstrath, Hub makes git better with GitHub
- Seth Robertson, On undoing, fixing, or removing commits in git
- Going back in time to split older commits – na blogu „ThoughtRAM - extend your memory”
Another common practice is to rebase the last few commits in your current branch
Interactive rebase on GitHub
git checkout issue16 # o ile commity są na tej gałęzi
git log --pretty=oneline HEAD~8..HEAD # sprawdzamy ostatnich 8 commitów
git rebase -i HEAD~4 # zmieniamy ostatnie 4 committy
.. edycja ..
.... edit -- jeśli chcemy poprawić ten commit lub coś do niego dodać
........ git reset HEAD^ # rollback the last commit
........ git status
........ git add --patch # lub dodajemy/edytujemy pliki
........
........ git rebase --continue
.... reword -- poprawiamy tekst wpisu do log
Uwaga: Na stronie manuala gitrevisions jest opisane znaczenie:
HEAD^
, ^HEAD
, HEAD~n
.
Teraz sprawdzamy wpisy log i scalamy wprowadzone zmiany:
git log --pretty=oneline
git rebase master # o ile jesteśmy na gałęzi issue16
git checkout master
git merge issue16
git branch -d issue16 # możemy usunąć scaloną gałąź
git reset --merge # merge
git reset --hard ORIG_HEAD # rebase
czyli, odkładanie pracy na później...
git stash
git stash list
git stash apply stash@{0} # przykłady
git stash drop stash@{0}