When I execute command git checkout master this is git output
Switched to branch ‘master’
Your branch and ‘origin/master’ have diverged,
and have 25 and 2 different commits each, respectively.
I have not intentionally diverged my master branch
Can someone throw light about how this could happen and how to fix it?
I believe this happens when you have added commits to your copy of the master branch and then the public master is updated. What you should do is create a new private branch and do your work in that, leaving your copy of master alone.
Thanks Rod.
Know, I cannot rebase the master branch. this is the git message:
Falling back to patching base and 3-way merge…
Auto-merging sql_upgrade.php
CONFLICT (content): Merge conflict in sql_upgrade.php
Failed to merge in the changes.
Patch failed at 0001 Automating sql_upgrade.php script, take 2
When you have resolved this problem run “git rebase --continue”.
Rod My local and remote master cannot be updated. Please advice
You didn’t want to rebase the master branch. I’m not an expert here and you might wait for Brady to chime in, but I think I’d first make a backup of the local repository and then do something like this:
git rebase --abort
git checkout -b work master
git checkout master
git fetch origin
git reset --hard origin/master
The idea is to undo the rebase, then save your current master branch to a new working branch, then revert your master branch to match the remote origin.
And finally, you’ll probably want to rebase work from master. It appears that will give you some conflicts to resolve.
Thanks Rod
I’m pretty sure you are an expert.
The root of the problem is that I modified my origin master (sql_upgrade.php) on github manually. Know I can not updated my repository from upstream. I forgot That L. Torvalds built git, and I tried to cut corners. BIG mistake.