rebasing vs merging

0 votes
What is the difference between rebasing and merging? Where do i use rebasing and where merge?
Dec 14, 2018 in Git & GitHub by Hannah
• 18,570 points

1 answer to this question.

+1 vote

Merging and rebasing are written for the same purpose of incorporating the various changes in your project. The only difference is, reabasing and merging use very different methods to achieve this. 

Let me explain the working with an example, suppose you're working on a particular branch and you've made a few new commits and you're friend is working on the master and he's also made a few new commits. You realize that the new changes he's made might be useful in your branch and now you're confused weather to use rebasing or merging.

If you choose to use the merge option, It creates a new "merge commit" which holds the history commits of both the branches(the branch you were working on and the branch your friend was working on-master). 

If you choosee the rebase option, it moves the entire branch that you've been working onto the master. In simpler terms Moving the base of the branch on different location. 

answered Dec 16, 2018 by Kiyara

Related Questions In Git & GitHub

0 votes
1 answer

Git pull vs Git Fetch

The objective of both these commands is ...READ MORE

answered Apr 26, 2018 in Git & GitHub by DragonLord999
• 8,450 points
+3 votes
1 answer

Git vs Mercurial

I'm going to put down pros and ...READ MORE

answered Sep 20, 2018 in Git & GitHub by lina
• 8,220 points
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
3 answers

What is git rebasing?

HI. Rebase is nothing but a Git utility ...READ MORE

answered Sep 4, 2020 in Git & GitHub by SRI
+4 votes
4 answers

Git push vs git push origin

In simple words git push command updates ...READ MORE

answered Apr 23, 2019 in Git & GitHub by Hiran
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points