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,159 views

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
1,280 views
+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
654 views
0 votes
1 answer
0 votes
0 answers

git - remote add origin vs remote set-url origin

I created a new repo: git init echo "# ...READ MORE

May 13, 2022 in Git & GitHub by Kichu
• 19,050 points
1,278 views
+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
3,458 views
+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
953 views
+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
247,584 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP