DEV Community

Discussion on: An Introduction to Git Rebase: A Tutorial

Collapse
 
emptypockets profile image
Andrey Kondratyuk

Quick question: after you checkout and pull the master branch, you have all of the code from both branches in your code editor right? If there is a code conflict at this point, don’t you have to choose which version to keep?

Is the goal of rebase to make it easier to make sense of each individual commit and make undoing a change easier?

The art/diagrams are great btw.

Collapse
 
za-h-ra profile image
Zahra Khan • Edited

Hey! Great question!

When you checkout and pull down code from the master branch, you have all the code from the remote master (which is everything everyone else is working on) into your local master branch so your branch matches and is up-to-date with the all the work that's being merged into the project as a whole.

I haven't experienced a code conflict with master/develop branches because when you're working in a feature branch, before merging, the team has to review it to make sure there aren't conflicts. BUT hypothetically, if there IS a conflict, you have to choose which change you'd like to keep. I've experienced conflicts in my feature branch, and then I have to decide which change makes sense to keep.

Conflicts are still something I'm terrified of haha and practicing solving to get better at so I wish I had a better explanation for it.

The goal of rebase is to have a cleaner branch history and keeping track of the commits you're making.

I hope this helps! Lmk if I made any sense haha

Thanks btw, appreciate it!

Collapse
 
emptypockets profile image
Andrey Kondratyuk

Yup, that really helps. Thank you.