How to Use Git as a Sole Developer

gitgithubsolo-development

I have multiple projects on Git that I eventually want to bring others into. However, right now it's just me and I use Git and GitHub very simplistically: no branches and basically just using the commits as a backup to my local files. Sometimes I'll go back and look at previous versions of my files for reference, but I haven't needed to do any rollbacks to this point, though I appreciate the option should I need it in the future.

As a sole developer, what Git or GitHub features could I take advantage of that would benefit me right now? What should my workflow be like?

Also, are there any particular practices that I need to start doing in anticipation of adding others to my projects in the future?

Best Answer

Also, are there any particular practices that I need to start doing in anticipation of adding others to my projects in the future?

Of course. There is a simple good practice that you can use even if you don't have a team right now: create a separated branch for development. The idea is that master branch will contain only released code versions or major changes. This can be adopted easily by new developers that join your project.

Besides, branching is useful even if you are working solo. For instance, you find a bug while in the process of coding a new feature. If you don't use branches, you will have to do both: add new features and fix the bug in the same branch. This is not good :P On the other hand, if you had created a new branch for creating your new feature, you can just checkout the development branch, fix the bug, and checkout back the new feature branch.

This is just a brief example of what you can do being a sole programmer. I am sure there must be more good practices.

I highly recommend you this article: A successful Git branching model

Related Topic