I'm new to coding and collaborating in git so I thought this would be a relatively normal thing.
We're a small team of three working on a project. One of the team members is working on a problem branch and we were going back and forth over one functionality. They said I could take a shot at optimizing it so I created a sub branch and started working on it (without explicitly stating that I was making a sub). They then submitted a PR to main while I was doing that, so I fetched their changes into my and approved the PR. After I was finished, I submitted a PR for my sub into their branch and asked them to review.
They're now mad and saying that I shouldn't touch someone's code after they're done or ever branch off of someone else's work. I don't understand how this would make sense for a large scale project, but is that different in smaller groups? Or am I just completely off base here and should have clearly stated I was making a sub.
Really hoping to understand best practices because git is already enough of a nightmare for me without also being rude to others!
Sorry this isn't a pure programming question. If it breaks any rules I'll take it down!