git TutorialIntroduction Installing Git Understanding Git architecture Initializing the new Git respository Cloning new Git repository .git directory in Git repository Viewing Git configuration First time Git configuration Using SSH keys with Git Checking Git status Adding files into staging area in Git Committing changes to the local repository Ignoring files using .gitignore Viewing the history of commits Viewing the file contents in working directory, staging area and repository Viewing difference between files Viewing the history of files Git revert Git Reset git reflog Creating and switching to new branches in Git Viewing existing branches Merging branches Resolving conflicts Rebase Deleting branches Renaming the branch in Git Push Pull Stashing the changes in Git Tags in Git Patches in Git Creating new repository on GitHub Pushing local repository to remote repository like GitHub IntelliJ IDEA
Merging using rebase in gitRebase is one of the branch merging strategy in Git. With 3 way merge strategy, git history becomes non-linear. But with rebase, Git history becomes linear. With rebase, commits of feature branch are played on the top of main branch thus creating a linear history. Below command will play the commits (up to common parent of both branches) of currently checked out branch on the top of feature_branch.
Below image would be useful in understanding the Git Rebase command. Here we are playing the commits of local branch (S and T) on the top of remote branch (Q and R). Here is the output of above example.
git rebase feature_branch
Complex problems, Simple Solutions