Some exercises and training on Interactive Rebasing.
Checkout to the exercise branches and follow the instructions
git branchto list all branches. (qto leave the screen)git checkout exercise-1to checkout to the exercise-1 branch
Assume the following history exists and the current branch is "topic":
A---B---C topic
/
D---E---F---G master
The result of the following command:
git rebase master
would be:
A'--B'--C' topic
/
D---E---F---G master
git log --onelineShows you git log with pretty formattinggit rebase -i HEAD~5Make a list of the commits which are about to be rebased. Let the user edit that list before rebasing starting at the5thcommit before HEAD.git rebase -i <commit hash>Make a list of the commits which are about to be rebased. Let the user edit that list before rebasing starting from the<commit hash>.git diff --checkShows all lines and files with conflictsgit add <filename>Adds the file back to stage after solving a conflictgit add -iInteractive staging: can help you craft your commits to include only certain combinations and parts of files.git rebase --abortUndo the rebase operationgit rebase --continueResume rebase operation after fixing the conflictsgit push --forceDisable checks when pushing to remote repository and can cause the remote repository to lose commits; use it with care. Needed when rebasing.