4 ms·
Svn to git protips
- Zev 17y agoThis article didn't seem to have anything to do with actually switching to Git; it was just a list of SVN commands without the Git equivilant. It did mention one difference thats worth mentioning: Since git doesn't keep empty directories, you can add a .gitkeep file to empty directories that you don't want to go away. However, I thought one of Git's selling points was that it didn't add a file to directories? And the site adding a link back to the blog when I went to copy and paste that quote? Eugh.
- weaksauce 17y agoI believe one of the selling points of git is that it does not add cruft to each directory as a general rule as it only has one .git directory in the root folder. The only time you would need to do that is if you wanted to keep an empty directory in the structure of the git repo. If checking out an empty folder with a dot file in it is not desired you could always add a post checkout hook to delete them. Though in that scheme you would lose your empty dirs on checkin I would wager(not sure though). Edit: you could probably do a precommit hook too to inject the dot files into the empty directories.
- zacharydanger 17y agoI think you might be missing the point of the article. It's tips for converting a Subversion repository to a Git repository.
- Zev 17y agoI did get that. What I didn't get was why it only showed the relevant svn commands, not how to do the same thing in git for all the items listed (ie: for "Find all authors"; format of an authors file? a link to git's docs? or how about recommending a specific module for "Show all externals"? or, again, a link to where to start looking for one?)
- steveklabnik 17y agoGit doesn't keep track of empty directories by default, so he's just making a file in each directory so that they're there. You could name such a file anything, he's just picking .gitkeep because it's descriptive.
- kelnos 17y ago"Protips"? Funny. The article is ridiculously light on details. From experience, I've found there's a lot more involved to converting a svn repo to git. After done, there's also something else I consider very important: verifying all the data after it's been moved. A few months ago, we (xfce.org) switched from svn to git. I kept track of what I did and published the scripts I used: http://git.xfce.org/admin/xfce-git-migration http://git.xfce.org/admin/xfce-git-migration Some of it is Xfce-specific, but I tried to abstract most of the site-specific stuff into env vars and such, so it should be reasonably adaptable to other sites.