Use git archive; something like:

git archive --format=tar --remote=$REPO $BRANCH | tar xf -

This command gets only the source tree with no git metadata (i.e., no .git subdirectory).  It is also very fast.  The command above writes the source code into the current directory; to write it into a subdirectory add the option --prefix=subdir/.

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐