for beginners++
Krzysztof Szumny - noisy
Real live examples:
git log --decorate --graph --oneline
git log
git log --decorate
git log --decorate --graph
git push <repo> <remote_branch>
git push origin feature-8
git push <repo> <branch>:<remote_branch>
git push origin feature-8:feature-8
git push <repo> <branch>:<remote_branch>
git push origin feature-8~1:feature-8
git push <repo> <branch>:<remote_branch>
git push origin :feature-8
git push <repo> --delete <remote_branch>
git push origin --delete feature-8
git reset --hard <hash/branch>
git reset --hard HEAD~1
git reset --hard origin/feature-8
1. New changes were pushed to base branch
2. when we want to delete a commit, which is not the last
3. commits are on wrong branch
*this is more difficult rebase, requires --onto
rebase is like automated version of cherry-pick
so let's explain very quickly how git cherry-pick works...
$ git cherry-pick feature-7~1
$ git rebase master
Lets take a look on git rebase --interactive
demo: https://asciinema.org/a/bgau9swvdqz2jqx7fxyjq57tb
$ git merge-base master feature-8
C
git merge-base <branch> <branch>
# being on feature-9
git rebase feature-8
# being on feature-8
git rebase master
# being on feature-9
git rebase feature-8 #???
# being on feature-9 git rebase --onto feature-8 feature-9~3 feature-9
Lecture: Git for beginners++