Rebase
- The current state of repository
- Now we need the change done on master branch in develop branch
-
So checkout to develop branch and execute
git rebase master
-
Rebase in other scenario
Cherry-pick
- Cherry-picking is where you require one or sequence of commits from one branch to another
- Consider the following graph
- In the master branch we need changes from commit id
9c3cc1b
-
Now the history looks as shown below
-
Articles:
- merge: Refer Here
- fast forward merge Refer Here
- rebase Refer Here
- cherry pick Refer Here
- merge vs rebase Refer Here
Find out what these expressions mean in git
- diff examples Refer Here
- git diff
.. - git diff
^.. - HEAD~5
- HEAD~1
Rewriting History
- We have used interactive rebasing to
- change commit messages
- combine commits
- remove commit
- edit commits
- Refer Here for re writing history
Exercises
- Find a way using cli to show
- all the commits done on a file
- show the files in a specific commit
- find all the commits between some dates