The only distributed revision control system I've used on my projects is bazaar. I don't know much about git and mercurial except how to do checkouts. The reason I like bazaar is the automv plugin. It detects when I've moved/deleted files manualy (from command line/ide etc.) which I tend to do alot when I'm in a hurry. But bazaar is really slow and I'm thinking of moving to git. Does git have something similar to this functionality?
The way Git works in the move/rename situation is quite different. Git tracks only content, so it knows that file X had SHA1 hash abc123...
at one commit, and file Y happened to have the same hash abc123...
at the next commit. So the Git tools, when viewing history or whatever, conclude that file X must have been renamed to filename Y at that point.
In this way, Git reconstructs the actions taken to move from one commit to the next, without having to have that knowledge at commit time. It can event detect situations where you rename a file and change something within the file (of course it doesn't do this by comparing SHA1 hashes, but by doing a text compare between files that were changed in a commit).
You might be looking for git add --all
:
Update files that git already knows about (same as
--update
) and add all untracked files that are not ignored by.gitignore
mechanism.
(Emphasis mine.)
Just for your information only bazaar knows moves. SVN, Git, hg only know copy with version and delete. I think that a different. But as mentioned before git handles the automv very well (as far as I heard), only be so clever to commit very quickly after move. I heard egit makes an autocommit after you rename a class.