Git merge creates a new commit that ties the histories of the main and feature branches without altering either branch. In contrast, git rebase moves the feature branch's history to the head of the main branch, but should not be used on public branches due to potential conflicts with other developers' work. The document highlights the non-destructive nature of git merge and the risks associated with git rebase.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
7 views5 pages
Git Merge AND Git Rebase: By: Jaya Sharma Awasthi
Git merge creates a new commit that ties the histories of the main and feature branches without altering either branch. In contrast, git rebase moves the feature branch's history to the head of the main branch, but should not be used on public branches due to potential conflicts with other developers' work. The document highlights the non-destructive nature of git merge and the risks associated with git rebase.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5
GIT MERGE
AND GIT REBASE
By: Jaya Sharma Awasthi
WHEN WE MERGE ONE GIT BRANCH TO ANOTHER, WE USE : git merge git rebase WHAT IS GIT MERGE?
This creates a new commit in the
main branch. It ties the histories of both main and feature branches.
Git merge is non-destructive. Neither
the main nor the feature branch is changed. WHAT IS GIT REBASE?
Git rebase moves the feature branch
histories to the head of the main branch. ISSUE IN GIT REBASE Git Rebase itself is not seriously dangerous.
The golden rule of git rebase is to
never use it on public branches. The rebase moves all of the commits in main onto the tip of feature . The problem is that this only happened in your repository.