Suggestions please for a home version control system

前端 未结 17 1810
我在风中等你
我在风中等你 2021-02-04 16:04

I have a home project that really needs to be in Source Control. I tried installing Subversion, which I have some experience with, but couldn\'t get it working. I don\'t parti

17条回答
  •  情深已故
    2021-02-04 16:34

    Don't be scared of by git. It has gotten far easier to use than it used to be!

    It fits all your requirements (open source/free/run on Win32/have a GUI, which is included), and there are lots of good resources available.

    As a really basic guide, using the command line (the "Git GUI" should be pretty self explanatory):

    1. mkdir myrepo - make a new directory, this could be an existing dir with your code in it
      • git init - makes the directory into a git repository. this basically adds a .git/ folder to the current directory. This is like using VisualSVN, creating a new repository then checking it out to a working directory (just without the server
      • vim myfile.txt - make a new file, if you have existing files, you obviously can skip this
      • git add myfile.txt - start tracking the new file (similar to svn add'ing a file)
      • git commit - commits whatever you have run git add on.

    ..and that's it. You have a version tracked file! When you change the file, you do git add myfile.txt again to "stage" the changes, then commit to add all the staged files into a commit.

    It's slightly different to how SVN works. With SVN, you commit a file, and it gets sent to the server. With git, you stage a file (or multiple files, or even bits of a file, which is very useful), then commit them.

    You can do all of the above easily (including creating repositories, staging specific lines in a file) in Git GUI.

    On Windows, install msysgit.

    Then, if you don't mind spending $9, watch the Peepcode GIT episode for a comprehensive overview of what git is, how it works, and how to use it.

    Alternatively, GitCasts are also a very good (free) set of screencasts, which cover most of the basic stuff. Watch the ones you think would be useful to you, I would recommend watching the setting up, then normal workflow, then GIT on windows

    Finally, GIT Magic is a great guide to doing everything with git. I use it a lot, despite having used git a lot over the last year or so (it's useful for answering "how do I..." things you forget. Say "how do I recover a lost commit", "how do I reset the repository to 4 revisions back")

    I would also recommend playing around with GitHub. It's a very nice to use git-hosting site. When you create a new repository, it gives you the list of commands to make a new repository, and push your changes to to github (something I didn't really cover - the distributed workflow gitcasts, the peepcode episode and git magic all cover this really well)

提交回复
热议问题