Git workflow for single user

前端 未结 3 943
梦毁少年i
梦毁少年i 2021-02-02 13:00

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, bu

3条回答
  •  后悔当初
    2021-02-02 13:45

    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.

提交回复
热议问题