I’ve written a few blogs about debating issues with the Team Lead. Another argument we had was about the use of Git Rebasing. The blog will be quite long if I go into the detail of what this means, but:
- Git is a type of source control
- Source control allows you to see the changes with the date/time they occurred
- You can create a “branch”, make your changes, then merge many changes at once into the “main” branch.
- There’s a concept of “merge” which basically keeps the timestamps they were originally made
- There’s another concept of “rebase” which creates new commits, so changes the timestamps like they have just been made.
This new team always rebase, and end up rebasing as they are developing in their branch. A well-known rule is that if multiple developers are working on the same branch, you cannot rebase it without causing problems to your team members.
I raised this as a potential issue because I saw many upcoming items we need to work on that need multiple developers working on a feature, or needing to work from a shared branch. The Team Lead dismissed because he has apparently never had problems working with rebase before.
As I forewarned, I got hit:
- Jay creates folder A with many files
- I branch from his changes
- Jay moves all those files to folder B
- rebases
- I then rebase my branch. Git can’t see the move because the history is rewritten. It keeps folder A with the old files and treats them as mine. It adds folder B with Jay’s edited files.
Later on, the Team Lead was hit with something similar.
Team Lead
rebased fine for me
Team Lead
hmm this is fucking me up now
i rebased onto jay's branch which went fine
Me
but now there is duplicates all over the shop
Team Lead
now i'm trying to rebase onto develop but it's trying to apply jay's commit to it too
Andrew
he rebased his branch again
before merging into develop
Team Lead
but it should recognise that my branch starts at my first commit though shouldn't it
Andrew
not if you rebased onto his before he rebased again
you just have to drop any of his commits
Team Lead
ah right, not come across that before but makes sense
So if you have multiple developers working in the same branch, you should not rebase once commits have been synced by one or more team members. Rewriting the commit history means Git cannot sync new changes because it sees everything as a new commit.

