4 ms·
Git Workflow for Agile Teams
- windsurfer 17y agoI'm still learning about Git and source control in general, and I love hearing about various workflows. And running tests before commit? Why not commit, run tests, then commit again? Do you really want to risk losing the work you just did because of a silly mistake (like piping something into a crucial file)?
- mrduncan 17y agoIf you're going to commit, run tests, and then commit again, I don't see a problem with it as long as you use git-rebase to squash those two commits together before you push them. The goal should always be to have the code in your main repository passing all tests at all times. I've personally never worked this way, I don't commit until all tests are passing and I can't think of any time where I've ran into issues with this process. To each his own.
- johnm 17y agoThe "test first" extreministas write a test, write code to make that test pass, make it green, then commit. Lather, rinse, repeat. So the window for loss is exactly the work done for one small step of improvement. I concur that it's nicest to then squash all of those tiny steps into a single feature/bug-fix chunk.
- DannoHung 17y agoWhy would testing nuke your work?
- JulianMorrison 17y agoIt's untested. Goodness knows what it does.