6 ms·
If you really just want a minimal source control system, Git does the trick well enough. I don't think you need anything more than 'git init' (make a fresh proj
by gcv 18y ago
If you really just want a minimal source control system, Git does the trick well enough. I don't think you need anything more than 'git init' (make a fresh project), 'git commit -a' (commit all new changes except for deleted or renamed files), 'git add' (to add new files), 'git rm' (to remove files), 'git checkout' (for reverting changes), 'git log' (obvious), and 'git diff' (also hopefully obvious). Put a .gitignore file in the root of your project listing globbed filenames for everything you don't want to manage. Run 'git commit' after every sequence of 'git add' or 'git rm' invocations. That's it. You shouldn't need any more documentation than this paragraph.
Branching is a killer feature, as is clean history management, as is the index, and when you find yourself wishing more control over what happens to your source code, wishing for freedom to experiment, all these tools will be there waiting for you.
- nostrademons 18y ago'git mv' for moving files, and I'm overly dependent upon 'git status' for checking what's changed.
- gcv 18y agoAgreed on both points, although 'git mv' is optional. As long as the old file is 'git rm'ed and the new file is 'git add'ed in the same commit, git detects the rename quite reliably.
- jrockway 18y agomv is just sugar, though, you can easily copy the file using unix "cp" and delete/add to get the same result. Git does not track renames.
- etal 18y agoOr, just use the Unix mv, and let Git figure out what you did at the next "git add .".
- maw 18y ago'git diff' (also hopefully obvious) Except it's not, since it'll output different things depending on whether you have staged anything or not. This behavior is sometimes useful, but hardly obvious. Many aspects of git are like this, and it's frustrating, speaking as someone who slowly came around to git and now likes it quite a bit and would recommend it, to see its advocates forget or try to talk around just how difficult it is to learn. (1.5 and 1.6 may have improvements, but the claim that git's now roughly as easy to learn as hg or bzr, especially without understanding its internals, is absurd.)