Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
D--M22667yIt doesn't matter.
You shouldn't ever be commiting non-working code to your master branch.
You make a branch for whatever feature your developing and commit whatever you want into there, whatever your preference/workstyle works with you.
Then merge that into master with a squash commit so you dont merge your broken commits in, only the commit that works. Then delete that branch. -
cursee165957yCommit is not an issue. Just commit as much as you can. The more commits the better chance to revisit.
Important thing is what @D--M mentioned. -
Kaskagues157yI'm sending this exact message to my beloved classmates who commit non-working functions cause they didn't know how to do it but their job was to code and commit that :D
@D--M -
ddephor44467yOnly commit changes that semantically belong together. Never ever commit things that do not belong together. You will regret it.
Official branches (incl. master/trunk) should only contain finished, working, tested code.
On your private branches you can commit whatever you want, either finished or unfinished, containing errors, missing features, whatever, as long as you stick to the above rule. If you do so, you can clean up from your VCS at every point before merging something anywhere else and everything is fine.
If not, you will end up merging manually, commiting it again, make mistakes, deliver buggy software, receive phone calls from QA/customer/CEO/CTO, fix your mistakes, introduce new errors, get mad, get depressed, quit your job, lose your apartement, leave your partner, and at the end the earth explodes. -
Kaskagues157yThis is getting quite helpful. Cause I've encounter some of those problems before that I could fix just by creating branches and grouping the commits properly. I'm taking this advices for sure. @ddephor
-
cursee165957y@Kaskagues might wanna dig this rant. I wanted to mention your name directly but cannot remember it 😁
https://devrant.com/rants/989536/... -
Kaskagues157yThat will take me a while (maybe a year to learn). But now that I see the real depth of working on a cloud repository with multiple people commiting, keeping it clean seems like a must.
You never end learning about programming @CurseMeSlowly
Related Rants
How do you usually divide the commits?
I'm a student and I would like to know your coding preferences at both work and your personal projects. Do you prefer to commit almost fully coded classes or you just rapid-fire all the functions you finished?
question
organizational behavior
code quality
style
commit
git