403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.217.126
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/python3-dulwich/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/python3-dulwich/examples/clone.py
"""Clone.

This trivial script demonstrates how to clone or lock a remote repository.

Example usage:
  1. python examples/clone.py git://github.com/jelmer/dulwich
  2. python examples/clone.py git://github.com/jelmer/dulwich.git
  3. python examples/clone.py git://github.com/jelmer/dulwich.git dulwich
"""


import sys

from os.path import basename

from getopt import getopt

from dulwich import porcelain


_, args = getopt(sys.argv, "", [])


if len(args) < 2:
    print("usage: %s host:path path" % (args[0], ))
    sys.exit(1)

elif len(args) < 3:
    target_path = basename(args[1].split(":")[-1])
    if target_path[-4:] == ".git":
        target_path = target_path[:-4]
else:
    target_path = args[2]

porcelain.clone(args[1], target_path)

Youez - 2016 - github.com/yon3zu
LinuXploit