Solved Git clone in not-empty UFS2 directory, containing .snap and .sujournal

On one of my PC, I keep /usr/src, /usr/ports and /usr/doc sources in separate freebsd-ufs partitions, on separate HDD/MBR.
This way, I can upgrade to the next snapshot (using ISO) -- both stable and current, and keep my Git clone-ed sources (same for CVS)

But Git needs empty directory, and freebsd-ufs partitions contain .snap directory and .sujournal file.
I've read ""But what if my /usr/ports directory isn't empty?!"" part of ShelLuser post at following thread. It is nice, but it looks like a kludge workaround.
Thread guide-using-git-to-manage-ports-source-and-documentation.79721

1. Does anyone else have the same problem?
2. Should I go with above solution, or there're some other workaround?
This is what I did originally:

zfs create zroot/usr/src
cd /usr/src
git clone
mv src/.??* src/* .
rmdir src
  • Thanks
Reactions: a6h
But Git needs empty directory, and freebsd-ufs partitions contain .snap directory and .sujournal file.

It doesn't need it, it's just bitching around.
I would clone into a temporary subdirectory and then move the stuff up. (Remember to grab the .git and other dotfiles, too)

The concerned files ,sujournal and whatever can then be handled by a global gitignore(5) (core.excludesFile)
"Looks like a kludge"?

It's a working method to clone a repository into a non-empty directory and it only requires 5 commands... While it is a work around it's hardly inefficient because... what do you think happens when you issue a clone command? That command issues several sub commands in sequence as well.

Sorry but I don't understand the problem, also considering that you'd normally clone a repository once.
  • Thanks
Reactions: a6h
"Looks like a kludge"?
I looked up "Kludge" in the Oxford Dictionary. It turned out it's even worst than what I though. So, it was poor choice of word from my side. It was my fault, I corrected it, and sorry for misunderstanding.