Why should I use version control if I'm working alone and already back up regularly?

后端 未结 16 1682
有刺的猬
有刺的猬 2021-02-05 16:53

I\'m working on a project:

  • Just me, no collaboration/source code sharing
  • I\'m already backing my code up regularly, and I can use Dropbox to restore mista
相关标签:
16条回答
  • 2021-02-05 17:25

    Ever look at some piece of code and think, "Why did I do that?" Source control will answer that for you, via timestamps and comments on each commit.

    And if nothing else, knowing how to use source control is a valuable skill for a developer.

    0 讨论(0)
  • 2021-02-05 17:28
    • Revision History
    • Check-in comments
    • Changesets
    • Branching
    • Tagging
    0 讨论(0)
  • 2021-02-05 17:29

    Ever make a change to a file and think "Oh sh**..., I wish I could undo that!".

    That's why a one man development team still needs version control.

    Edit: I should clarify that version control allows you to cherry pick revisions over your entire project history. With most systems you can do a side-by-side compare before reverting as well. This is a far cry from simply picking a backup at some point, restoring it, and hoping you have the file you wanted.

    0 讨论(0)
  • 2021-02-05 17:29

    In addition to already listed

    • gives you metrics (you can see how many commits you made, when and even for what reason)
    • comments - gives you another place to document and organize your code, which in turn gives you a new ways to manage your code
    • memory - you can track exactly what you changed when you were fixing such and such issue (you have full trackback at your disposal)
    0 讨论(0)
  • 2021-02-05 17:30

    Lots of good reasons why to do it in the other answers. Personally, I like knowing I can look back at code that "used to work before I tried to fix that bug"; a situation that occurs far more often than I'd like.

    For my personal needs, I've found that fossil is a good choice. It is distributed, low ceremony, installs as a single executable file, and available for Windows, Mac, and Linux out of the box and portable beyond that. It provides a wiki and ticket tracking in addition to revision control. It has a built-in web server, used along with your browser to provide a GUI for management tasks, and useful for ad-hoc cloning and updates. It is easily integrated with a web host. Its home site is served by a copy of fossil, for instance.

    0 讨论(0)
  • 2021-02-05 17:33

    I recommend using bzr as it works best for someone who is just using it for their own code (not a team) as it doesn't require backing up to a server (all revisions are stored with each "branch")...

    As far as the benefit, its so you can roll-back changes in the code to any point in time, so if you do daily backups, you can roll-back the code to get it from any day that you made a backup. This way you can feel comfortable re-writing code or deleting old code that you think you won't need but if you do end up needing it again it is accessible. For larger projects it helps with debugging since, if a new feature makes a bug appear you can roll-back to earlier if needed.

    0 讨论(0)
提交回复
热议问题