Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjlampstack
23,932 PointsBest practices for committing changes
Given the limited amount of characters we have to describe the commit message it makes sense to me to commit one file at a time so we can return a more detailed and accurate history of changes when using the git log --oneline
command.
On the flip side, this adds a lot more commit messages to skim through and can clutter the commit history.
What is considered a best practice for committing changes?
1 Answer
Indiya Gooch
12,075 PointsThis can be dependant on a multitude of factors, including workplace guidelines (if any) and personal preference, and the way used to commit - for example using a command line (terminal on mac) or github Desktop.
With github Desktop the current interface allows you to have a 'title' and 'description' for your commit,meaning you can have a memorable 'title' that will appear for the --oneline command, but a 'description' also that you can access separately via github, or the desktop interface, so that if needed you can document what changes have been made in length to each file without cluttering the commit history.