I need help in understanding git rebase for this situation. I checked out a branch created by some one 10 days back. I checked out using
git checkout -b <some name> origin/branchname
(I just used different name to identify it)
After checkout, if I do rebase by being in this checked out branch,
git rebase origin/master
It shows some errors like
1) Trailing whitespace – I read about this but even after trying this command that I found online, i still see the warnings.
git config core.whitespace nowarn
2) Auto-merging
CONFLICT (add/add): Merge conflict in…
these files are in master branch but the content is modified a little bit in the checkout branch. So how should I fix this? I don’t have authority to change anything in master directly if that’s the way to fix it. These files should have the content from this checkout branch so that the testing will work fine as it’s related to that..please clarify me..
regards
Guys have pretty much answered the question about whitespaces but didn’t touch the rebase part of the question. Here is what’s happening when you rebase:
first your checking out to some branch, then you say:
This means that you would like to rebase the current HEAD (your topic branch) onto master.
Git is going back in history of your topic branch and in history of master branch and finds a commit that is a first common ancestor for both of them. This commit will be an old base for your topic branch. Then it takes all commits that happened since then in your branch and “reapplies” them in the order of appearance on top of the current master. Sometimes conflict can happen, then the rebase process stops and waits for your resolution. So you have have to manually resolve them by editing files and then marking them as resolved by
git add conflicted_fileWhen this is done you will have to say
git rebase --continueNow you’re NOT changing files in master branch by doing that – the changes are happening in your topic branch and conflicts resolution are recorded in your topic branch.
hope that helps.