Bi-Weekly Learning Update (48!)

It’s a good idea to get started with Git fairly early on for version control. It’s a little hard to get in the habit if you’re working on small projects by yourself, but spending some time learning to use it effectively will pay off! I wanted to show a couple good practices you should get in the habit of following.

1 commit, 1 goal. This doesn’t mean you should only ever make one or two commits per projects [or that you should make loads, either!] Rather, each commit should accomplish only one thing. The commit messages should read like a to-do list; it should be broken into chunks, and while each commit may modify many files, it should only accomplish one task. Commit Often, Perfect Later, Publish.

Manage your branches. Create a new branch to work on a feature. Once you’ve completed the feature and made your commit, merge it into the master branch, so you can share it! This means you always [in theory!] have a presentable master branch, and the messy or incomplete [arts are kept aside until they are ready.

Meaningful commit messages. Even if it seems obvious at the time, assigning a meaningful message will make your project much easier for someone else to pick up and understand or even *gasp* contribute to it! Another small thing to note is that commit messages should be in the present tense [“Add view for…” instead of ” Added view for…”]

Git out there and practice! By all means, do lots of short tutorials on Git, but the best way to learn is to stick with it and use it for a project you’re actively working on, and commit yourself to using it as long as you’re working on the project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s