|
|
|
|
|
by AceJohnny2
4260 days ago
|
|
Yeah, the git in the bash prompt thing was the most annoying thing to me, honestly :) Since there is interest, I'll elaborate on the understated "a bit painful" part of moving the files after an initial clone which leaves the files in the ~/dotfiles dir. The problem is that I didn't find an easy "move and overwrite recursively" command in Linux. Here's the magic command from my script:
git ls-files --cached -z | rsync -av --from0 --remove-source-files --files-from - ${dir} ~/ && find . -type d -empty -delete To spell it out, it's having git list all the files in the repo (so skipping any unversioned files such as the .git dir itself), using the NUL byte as file termination to avoid any (most?) special character issues in file names, and using rsync to move the files over thanks to --remove-source-files. However rsync doesn't remove empty directories (durr), so have the find do that. Also, you probably want to set "git config status.showUntrackedFiles no" ;) |
|
[1] https://github.com/mbudde/homedir/blob/master/usr/bin/hgit