Exact `svn export` equivalent command for git?

前端 未结 8 859
花落未央
花落未央 2021-02-06 04:53

There is no exact svn export equivalent command for git? Really?

Beware: this is not a duplicate question. That is, I already know and have

相关标签:
8条回答
  • 2021-02-06 05:36

    At some hostings like GitHub you can make exact svn export.

    Example:

    svn export https://github.com/GNOME/banshee/branches/master
    

    Even partial! (some subpart of the repository)

    Example:

    svn export https://github.com/liferay/liferay-portal/branches/6.1.x/tools
    

    For your own repository you should create some GitHub repository and add it as a remote:

    git remote add github https://github.com/<user>/<repo>.git
    

    then

    git push github <branch>
    

    Now you able to do a partial checkout as above.

    0 讨论(0)
  • 2021-02-06 05:36

    Re your point, git archive <- This would be the perfect solution ...but it only has 2 possible formats: tar or zip, you can add new formats using documentation from the EXAMPLES section of the git-archive(1) man page:

       git config tar.tar.xz.command "xz -c"
           Configure a "tar.xz" format for making LZMA-compressed tarfiles.
           You can use it specifying --format=tar.xz, or by creating an output
           file like -o foo.tar.xz.
    

    While being "on windows" is generally considered an impediment to many tasks, with a little extra work, you can almost catch up to the folks running other operating systems by using software like Cygwin or MKS Toolkit.

    If after confirming that whatever command you need is available from within your shell, this sort of git config … command still doesn't work for you, then you should perhaps post additional details about your configuration in a question on SuperUser.com.

    0 讨论(0)
提交回复
热议问题