简体   繁体   中英

git svn does not fetch directory

My svn repo contains (among others) an empty directory called nativeLibrary . From my local git workspace, git svn rebase does not grab it. It also does not come with a fresh git svn clone .

Subversion does get the directory in my parallel svn local workspace. If I delete it, and do svn up it comes back.

Any idea why git svn rebase (or fetch ) doesn't grab it? Is there some way to force it? Any debugging suggestions? Thanks.

Git revisions files, and SVN revisions file systems. While both deal in the same domain of work, the means by which they do so differ. For most cases these differences don't extend to the user, in other cases they become obvious.

Since there is no file, and git does not represent the directory independently, git cannot represent the directory. Since SVN tracks changes to a directory tree (file system) svn can represent the directory independently. So, when using git svn , svn reports something that git cannot represent, and git must drop it. This is not a git bug, it is a reasonable solution considering that git doesn't even have a "word" in its language to describe what happened.

Git comes from a long line of file based source code control systems. None of the file based source code control systems can represent a directory independently, it is always done as a "after affect" of a tracked file. So if you have a file (.gitignore has been suggested), then the file will have a directory location, and the directory will be created just-in-time to put the file in the right spot.

i suppose this has nothing to do with git svn and is to blame on git alone. git does not track empty folders. if you want to force git to keep a folder, place some file in it, eg .gitignore or .keep .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM