Quick "git clone" from remote repository?
I'm new to Git. Starting work on any project seems to start with a "git clone". But this seems to take a long time - much longer than the equivalent "svn checkout". 开发者_JAVA百科Is this because the entire history of the project since the dawn of time is being copied? Is it possible to skip the history, and just get the latest files (but retain repository information, allowing future pulls etc).
You can use git clone --depth=$NUM_REVISIONS
, which has the following caveats:
Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.
No, it's not possible. If you want to participate in a repository's history, you must have the entire history to build from. While it does take a bit longer than an SVN checkout, it's still quite fast unless you're doing it over a slow connection and/or have a really huge project.
精彩评论