wbg
wbg

Reputation: 918

Git Newbie: Work flow for a one person project

I'm learning to use git to manage my code for a small lab. Right now, I'm the only developer.

I have a repo setup and I've been committing locally and pushing to the origin. I'm confused about when I should clone the repo. In fact, I'm confused about the workflow in general, especially when there's only one developer, no features to branch on yet, but I do have a working code base that I'd like to not keep breaking with minor commits.

I like to push my code at the end of the day to protect my work in-progress.

TIA

EDIT: clone should be checkout EDIT2: perhaps check should = branch

Upvotes: 2

Views: 1009

Answers (1)

Klas Mellbourn
Klas Mellbourn

Reputation: 44347

If you have already setup a repo and pushed it to a remote, there is not currently any need to make another clone. The need for a clone would for instance occur when you want to continue your work on a new machine.

A classic branching strategy is described here. There are scripting tools to support it here. However, it might be a bit over-engineered if you are a single developer working on a small lab.

However, if you have a stable code base that you want to avoid disturbing with minor commits, you should make liberal use of branches. Branching and merging is cheap and simple in git. Create a branch as soon as you start work on a feature. Commit your feature work to that branch. Merge the feature branch to master when stable. (Or rebase if you like a straight version history, since you are the sole developer it is completely safe).

Pushing daily sounds like an excellent idea.

Upvotes: 4

Related Questions