I am a single man shop developing a handful of desktop applications and websites. I started using GIT for version control a few months ago, and I am reasonably happy with it, but my usage is pretty clumsy and I am wondering what the workflow should be for a single user.
Right now, I have a .git folder in each of my project folders. I commit my changes every once in a while and I just keep working on the working copy.
I never pull anything from the Git repository (the working copy is still there, would it get overwritten by Git?), and I am not quite sure what would happen if I created a branch (Where is the branch created? Same folder?)
In other words, I am using Git mostly to see differences with old versions when needed, while still working the same old way.
It's fine, and even a basic set-up like this has advantages, but I feel that I am missing the point.
What should the workflow be like for a one-man shop?
The normal workflow is to develop and check in on a branch, then once everything is happy, merge the branch back into the master. The local repository consists of three "trees" maintained by git. The first one is your Working Directory which holds the actual files.
Git is free and open-source software distributed under the terms of the GNU General Public License version 2. Git is awesome because it helps keep track of changes in code and allows collaboration on projects of all scale.
I never pull anything from the Git repository (the working copy is still there, would it get overwritten by Git?),
With git, the "working copy" is a repository! The "pull" command is for pulling changes from other repositories. As a single developer you do not need it.
and I am not quite sure what would happen if I created a branch (Where is the branch created? Same folder?)
In your local repository, yes.
It's fine, and even a basic set-up like this has advantages, but I feel that I am missing the point.
Most of git's "new exciting" features are geared towards collaboration. Remember that it was developed to support the development of the Linux kernel, where literally hundreds of people contribute and simply keeping track of and merging the commits is a full-time job. Some of the features are useful pretty much only in such an extreme scenario.
But there are also some big advantages for single developers.
What should the workflow be like for a one-man shop?
Your current workflow is OK (assuming that you make regular backups; a remote repository can server that purpose as well). It could be improved by using feature branches. This allows your version history to be cleaner when you work on several things at the same time (and can prevent serious mistakes sometimes).
A somewhat related, very useful git feature is the stash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With