My eyes are destroyed. I am using a screen reader.
We are using git as our version control system on our project. We host our own server and use ssh to access it. We put each module under separate branches, then merge them all to a branch called dev for testing. Then when we determined that everything is stable, we merge dev to master.
Lately I am finding we are using remote branches in an unusual way. For example, suppose my partner found a bug he couldn't fix. Tipically I would ask him to read the code and suggest some fixes. If that is imposible (e.g. he does not know what to read or code is too long), we do the following.
- He commits the file containing the bug and pushes it to the remote branch.
- I would then pull his last commit and read his code and try to understand the bug.
- This repeats over and over until the bug is fixed. Sometimes I would ask him to push related files to the current file (E.G. maybe the problem is how json data is formatted so I have to read the file that submits the json object to the current file.)
For me, Git made this process very easy. I now have a way to personally inspect someones code without annoying people to reread a large portion of their code to me if I want something clarified. However, I believe we are using commits in a very bad way. I couldn't easily delete those commits in the local branch because they are already pushed into the remote branch.
My first solution is: when merging my module to dev, I would exclude all commits that are not real commits using some identifier or some range. The problem is the commits are scattered depending on when the bug occurred and what time. Rebasing them could be very time consuming and unproductive to the other developers on the team. I don't know how to achieve what I want.
What should I do?
git rebase -i
) because of the time commitment? Or is it because of the lack of value for the effort and time expended? If it is the former, I'm not sure there is anything you can do short of writing a script to download your repo periodically, looking for commits with some identifier and squashing / removing the commits then force pushing (which will cause so many other problems). If it's the latter (low value), then what's the harm of just leaving them there?git merge --squash
) if you are OK with turning the whole branch into a single commit when you merge.