github.com/1800alex/go-git-cmd-wrapper/v2@v2.2.5/clone/clone_gen.go (about)

     1  package clone
     2  
     3  // CODE GENERATED AUTOMATICALLY
     4  // THIS FILE MUST NOT BE EDITED BY HAND
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/1800alex/go-git-cmd-wrapper/v2/types"
    10  )
    11  
    12  // Bare Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>/.git, make the <directory> itself the $GIT_DIR. This obviously implies the -n because there is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to corresponding local branch heads, without mapping them to refs/remotes/origin/. When this option is used, neither remote-tracking branches nor the related configuration variables are created.
    13  // --bare
    14  func Bare(g *types.Cmd) {
    15  	g.AddOptions("--bare")
    16  }
    17  
    18  // Branch Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out.  --branch can also take tags and detaches the HEAD at that commit in the resulting repository.
    19  // --branch <name>, -b <name>
    20  func Branch(name string) func(*types.Cmd) {
    21  	return func(g *types.Cmd) {
    22  		g.AddOptions("--branch")
    23  		g.AddOptions(name)
    24  	}
    25  }
    26  
    27  // Depth Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules.
    28  // --depth <depth>
    29  func Depth(value string) func(*types.Cmd) {
    30  	return func(g *types.Cmd) {
    31  		g.AddOptions("--depth")
    32  		g.AddOptions(value)
    33  	}
    34  }
    35  
    36  // Dissociate Borrow the objects from reference repositories specified with the --reference options only to reduce network transfer, and stop borrowing from them after a clone is made by making necessary local copies of borrowed objects. This option can also be used when cloning locally from a repository that already borrows objects from another repository—the new repository will borrow objects from the same repository, and this option can be used to stop the borrowing.
    37  // --dissociate
    38  func Dissociate(g *types.Cmd) {
    39  	g.AddOptions("--dissociate")
    40  }
    41  
    42  // Jobs The number of submodules fetched at the same time. Defaults to the submodule.fetchJobs option.
    43  // -j <n>, --jobs <n>
    44  func Jobs(n string) func(*types.Cmd) {
    45  	return func(g *types.Cmd) {
    46  		g.AddOptions("--jobs")
    47  		g.AddOptions(n)
    48  	}
    49  }
    50  
    51  // Local When the repository to clone from is on a local machine, this flag bypasses the normal 'Git aware' transport mechanism and clones the repository by making a copy of HEAD and everything under objects and refs directories. The files under .git/objects/ directory are hardlinked to save space when possible.
    52  // --local, -l
    53  func Local(g *types.Cmd) {
    54  	g.AddOptions("--local")
    55  }
    56  
    57  // Mirror Set up a mirror of the source repository. This implies --bare. Compared to --bare, --mirror not only maps local branches of the source to local branches of the target, it maps all refs (including remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update in the target repository.
    58  // --mirror
    59  func Mirror(g *types.Cmd) {
    60  	g.AddOptions("--mirror")
    61  }
    62  
    63  // NoCheckout No checkout of HEAD is performed after the clone is complete.
    64  // --no-checkout, -n
    65  func NoCheckout(g *types.Cmd) {
    66  	g.AddOptions("--no-checkout")
    67  }
    68  
    69  // NoHardlinks Force the cloning process from a repository on a local filesystem to copy the files under the .git/objects directory instead of using hardlinks. This may be desirable if you are trying to make a back-up of your repository.
    70  // --no-hardlinks
    71  func NoHardlinks(g *types.Cmd) {
    72  	g.AddOptions("--no-hardlinks")
    73  }
    74  
    75  // NoShallowSubmodules All submodules which are cloned will be shallow with a depth of 1.
    76  // --no-shallow-submodules
    77  func NoShallowSubmodules(g *types.Cmd) {
    78  	g.AddOptions("--no-shallow-submodules")
    79  }
    80  
    81  // NoSingleBranch Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.
    82  // --no-single-branch
    83  func NoSingleBranch(g *types.Cmd) {
    84  	g.AddOptions("--no-single-branch")
    85  }
    86  
    87  // Origin Instead of using the remote name origin to keep track of the upstream repository, use <name>.
    88  // --origin <name>, -o <name>
    89  func Origin(name string) func(*types.Cmd) {
    90  	return func(g *types.Cmd) {
    91  		g.AddOptions("--origin")
    92  		g.AddOptions(name)
    93  	}
    94  }
    95  
    96  // Progress Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.
    97  // --progress
    98  func Progress(g *types.Cmd) {
    99  	g.AddOptions("--progress")
   100  }
   101  
   102  // Quiet Operate quietly. Progress is not reported to the standard error stream.
   103  // --quiet, -q
   104  func Quiet(g *types.Cmd) {
   105  	g.AddOptions("--quiet")
   106  }
   107  
   108  // RecurseSubmodules After the clone is created, initialize and clone submodules within based on the provided pathspec. If no pathspec is provided, all submodules are initialized and cloned. Submodules are initialized and cloned using their default settings. The resulting clone has submodule.active set to the provided pathspec, or '.' (meaning all submodules) if no pathspec is provided. This is equivalent to running git submodule update --init --recursive immediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given)
   109  // --recurse-submodules[=<pathspec>]
   110  func RecurseSubmodules(pathspec string) func(*types.Cmd) {
   111  	return func(g *types.Cmd) {
   112  		if len(pathspec) == 0 {
   113  			g.AddOptions("--recurse-submodules")
   114  		} else {
   115  			g.AddOptions(fmt.Sprintf("--recurse-submodules=%s", pathspec))
   116  		}
   117  	}
   118  }
   119  
   120  // SeparateGitDir Instead of placing the cloned repository where it is supposed to be, place the cloned repository at the specified directory, then make a filesystem-agnostic Git symbolic link to there. The result is Git repository can be separated from working tree.
   121  // --separate-git-dir=<git dir>
   122  func SeparateGitDir(gitDir string) func(*types.Cmd) {
   123  	return func(g *types.Cmd) {
   124  		g.AddOptions(fmt.Sprintf("--separate-git-dir=%s", gitDir))
   125  	}
   126  }
   127  
   128  // ShallowExclude Create a shallow clone with a history, excluding commits reachable from a specified remote branch or tag. This option can be specified multiple times.
   129  // --shallow-exclude=<revision>
   130  func ShallowExclude(revision string) func(*types.Cmd) {
   131  	return func(g *types.Cmd) {
   132  		g.AddOptions(fmt.Sprintf("--shallow-exclude=%s", revision))
   133  	}
   134  }
   135  
   136  // ShallowSince Create a shallow clone with a history after the specified time.
   137  // --shallow-since=<date>
   138  func ShallowSince(date string) func(*types.Cmd) {
   139  	return func(g *types.Cmd) {
   140  		g.AddOptions(fmt.Sprintf("--shallow-since=%s", date))
   141  	}
   142  }
   143  
   144  // ShallowSubmodules All submodules which are cloned will be shallow with a depth of 1.
   145  // --shallow-submodules
   146  func ShallowSubmodules(g *types.Cmd) {
   147  	g.AddOptions("--shallow-submodules")
   148  }
   149  
   150  // Shared When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository. The resulting repository starts out without any object of its own.
   151  // --shared, -s
   152  func Shared(g *types.Cmd) {
   153  	g.AddOptions("--shared")
   154  }
   155  
   156  // SingleBranch Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when --single-branch clone was made, no remote-tracking branch is created.
   157  // --single-branch
   158  func SingleBranch(g *types.Cmd) {
   159  	g.AddOptions("--single-branch")
   160  }
   161  
   162  // Template Specify the directory from which templates will be used; (See the 'TEMPLATE DIRECTORY' section of git-init(1).)
   163  // --template=<template_directory>
   164  func Template(templateDirectory string) func(*types.Cmd) {
   165  	return func(g *types.Cmd) {
   166  		g.AddOptions(fmt.Sprintf("--template=%s", templateDirectory))
   167  	}
   168  }
   169  
   170  // UploadPack When given, and the repository to clone from is accessed via ssh, this specifies a non-default path for the command run on the other end.
   171  // --upload-pack <upload-pack>, -u <upload-pack>
   172  func UploadPack(value string) func(*types.Cmd) {
   173  	return func(g *types.Cmd) {
   174  		g.AddOptions("--upload-pack")
   175  		g.AddOptions(value)
   176  	}
   177  }
   178  
   179  // Verbose Run verbosely. Does not affect the reporting of progress status to the standard error stream.
   180  // --verbose, -v
   181  func Verbose(g *types.Cmd) {
   182  	g.AddOptions("--verbose")
   183  }