Design comparison
Solution retrospective
I was wondering when the best time to commit code is. I have very little experience using GIT and I would like to at least know what the general rule of thumb is for add(ing), commit(ing) and push(ing) code.
Community feedback
- @kem522Posted about 3 years ago
Hi! Nice work, the styling is very well organised and easy to read.
In regards to your question about committing ... there isn't really one rule of thumb. I've worked in a couple of different companies and they did things differently and even different teams within my current company have different standards. Sometimes even people within each team commit differently!
For me, it's important to commit in chunks that are logical so that you can write one short commit message that explains all of the changes in the commit. For example, if I was going to make a calculator app I probably wouldn't commit all of the math functionality at the same time as adding all the HTML and styling.
This both makes it easier for other developers to review your code by commit and understand what you've done but if something were to go wrong and you wanted to roll back a change you might not have to get rid of all the work. Say my functionality was broken but the styling was fine, if that was all in one commit I'd need to roll back all of those changes instead of just the broken part.
Marked as helpful2@N-NikolaevPosted about 3 years ago@kem522
This is more than what I was hoping to get, thank you.
I'll keep this in mind moving forward.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord