I'm currently experimenting with git and encountered the following problem. I created a python file with one function called f1 and saved it under main.py and committed it to the master branch. I then created a branch called b1 of that, went back to the master and changed the name of that function to f2 (no other changes). Back in the branch b1 I added a second function called new_function. After that I tried to rebase b1 onto master.
I was surprised to see that there was a conflict. Why isn't git seeing that I simply changed the name of f1 to f2 in the master?
Am I doing anything wrong? Any suggestions are appreciated.
You are not doing anything wrong. Git is simply preventing any potential loss of your work. At this point, since function
f1has been changed tof2in yourmasterbranch - your branchb2still refers to it asf1. So, when you dogit rebase, git will simply ask you "so what name do you want it to bef1,f2or something else.