Answer the question
In order to leave comments, you need to log in
How to add empty folders when importing from SVN to Git script on Windows?
The essence of the problem is that I need to migrate several repositories from SVN to Git on Windows. Some of the repositories have empty folders and they are critical for projects and these folders cannot be deleted without breaking the project.
The git svn clone command has --preserve-empty-dirs option, I use it with add. parameter --placeholder-filename=.gitkeep , but it doesn't work, no way.
It looks something like this:
D system/drivers/twi/.gitkeep
Use of uninitialized value $rec in scalar chomp at C:/Program Files/Git/mingw64/
share/perl5/Git.pm line 557, <$fh> chunk 1.
D system/drivers /twi/
M system.svc
W: -empty_dir: system/drivers/twi
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do (fsutil file createnew %%d/.gitkeep 0 && echo.>%d/.gitkeep)
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do (echo.>%d/.gitkeep)
Answer the question
In order to leave comments, you need to log in
No way (I'm too lazy to pervert with this under Windows with flawed and inconvenient syntax). Made a crutch for Ubuntu:
echo The crutches for git svn clone --preserve-empty-dirs command, because it is not working properly.
find . -type d -empty -not -path "./.git/*" -exec echo blablabla>.gitkeep \;
git add --all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question