Clone Cd Portable

0 views
Skip to first unread message

Yvone Samiento

unread,
Jul 25, 2024, 9:32:00 PM7/25/24
to libxbee

After the clone, a plain git fetch without arguments will updateall the remote-tracking branches, and a git pull withoutarguments will in addition merge the remote master branch into thecurrent master branch, if any (this is untrue when --single-branchis given; see below).

When the repository to clone from is on a local machine,this flag bypasses the normal "Git aware" transportmechanism and clones the repository by making a copy ofHEAD and everything under objects and refs directories.The files under .git/objects/ directory are hardlinkedto save space when possible.

If the repository is specified as a local path (e.g., /path/to/repo),this is the default, and --local is essentially a no-op. If therepository is specified as a URL, then this flag is ignored (and wenever use the local optimizations). Specifying --no-local willoverride the default when /path/to/repo is given, using the regularGit transport instead.

Force the cloning process from a repository on a localfilesystem to copy the files under the .git/objectsdirectory instead of using hardlinks. This may be desirableif you are trying to make a back-up of your repository.

When the repository to clone is on the local machine,instead of using hard links, automatically setup.git/objects/info/alternates to share the objectswith the source repository. The resulting repositorystarts out without any object of its own.

NOTE: this is a possibly dangerous operation; do not useit unless you understand what it does. If you clone yourrepository using this option and then delete branches (or use anyother Git command that makes any existing commit unreferenced) in thesource repository, some objects may become unreferenced (or dangling).These objects may be removed by normal Git operations (such as git commit)which automatically call git maintenance run --auto. (Seegit-maintenance[1].) If these objects are removed and were referencedby the cloned repository, then the cloned repository will become corrupt.

Note that running git repack without the --local option in a repositorycloned with --shared will copy objects from the source repository into a packin the cloned repository, removing the disk space savings of clone --shared.It is safe, however, to run git gc, which uses the --local option bydefault.

If you want to break the dependency of a repository cloned with --shared onits source repository, you can simply run git repack -a to copy allobjects from the source repository into a pack in the cloned repository.

If the reference is on the local machine,automatically setup .git/objects/info/alternates toobtain objects from the reference . Usingan already existing repository as an alternate willrequire fewer objects to be copied from the repositorybeing cloned, reducing network and local storage costs.When using the --reference-if-able, a non existingdirectory is skipped with a warning instead of abortingthe clone.

Progress status is reported on the standard error streamby default when it is attached to a terminal, unless --quietis specified. This flag forces progress status even if thestandard error stream is not directed to a terminal.

Make a bare Git repository. That is, instead ofcreating and placing the administrativefiles in `/.git`, make the itself the $GIT_DIR. This obviously implies the --no-checkoutbecause there is nowhere to check out the working tree.Also the branch heads at the remote are copied directlyto corresponding local branch heads, without mappingthem to refs/remotes/origin/. When this option isused, neither remote-tracking branches nor the relatedconfiguration variables are created.

Use the partial clone feature and request that the server sendsa subset of reachable objects according to a given object filter.When using --filter, the supplied is used forthe partial clone filter. For example, --filter=blob:none willfilter out all blobs (file contents) until needed by Git. Also,--filter=blob:limit= will filter out all blobs of sizeat least . For more details on filter specifications, seethe --filter option in git-rev-list[1].

Also apply the partial clone filter to any submodules in the repository.Requires --filter and --recurse-submodules. This can be turned on bydefault by setting the clone.filterSubmodules config option.

Set up a mirror of the source repository. This implies --bare.Compared to --bare, --mirror not only maps local branches of thesource to local branches of the target, it maps all refs (includingremote-tracking branches, notes etc.) and sets up a refspec configuration suchthat all these refs are overwritten by a git remote update in thetarget repository.

Set a configuration variable in the newly-created repository;this takes effect immediately after the repository isinitialized, but before the remote history is fetched or anyfiles checked out. The is in the same format as expected bygit-config[1] (e.g., core.eol=true). If multiplevalues are given for the same key, each value will be written tothe config file. This makes it safe, for example, to addadditional fetch refspecs to the origin remote.

Due to limitations of the current implementation, some configurationvariables do not take effect until after the initial fetch and checkout.Configuration variables known to not take effect are:remote..mirror and remote..tagOpt. Use thecorresponding --mirror and --no-tags options instead.

Create a shallow clone with a history truncated to thespecified number of commits. Implies --single-branch unless--no-single-branch is given to fetch the histories near thetips of all branches. If you want to clone submodules shallowly,also pass --shallow-submodules.

Can be used in conjunction with --single-branch to clone andmaintain a branch with no references other than a single clonedbranch. This is useful e.g. to maintain minimal clones of the defaultbranch of some repository for search indexing.

After the clone is created, initialize and clone submoduleswithin based on the provided . If no = isprovided, all submodules are initialized and cloned.This option can be given multiple times for pathspecs consistingof multiple entries. The resulting clone has submodule.active set tothe provided pathspec, or "." (meaning all submodules) if nopathspec is provided.

Submodules are initialized and cloned using their default settings. This isequivalent to runninggit submodule update --init --recursive immediately afterthe clone is finished. This option is ignored if the cloned repository doesnot have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare,or --mirror is given)

Instead of placing the cloned repository where it is supposedto 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 workingtree.

The name of a new directory to clone into. The "humanish"part of the source repository is used if no isexplicitly given (repo for /path/to/repo.git and foofor host.xz:foo/.git). Cloning into an existing directoryis only allowed if the directory is empty.

Before fetching from the remote, fetch a bundle from the given and unbundle the data into the local repository. The refsin the bundle will be stored under the hidden refs/bundle/*namespace. This option is incompatible with --depth,--shallow-since, and --shallow-exclude.

In general, URLs contain information about the transport protocol, theaddress of the remote server, and the path to the repository.Depending on the transport protocol, some of this information may beabsent.

This syntax is only recognized if there are no slashes before thefirst colon. This helps differentiate a local path that contains acolon. For example the local path foo:bar could be specified as anabsolute path or ./foo:bar to avoid being misinterpreted as an sshurl.

If there are a large number of similarly-named remote repositories andyou want to use a different format for them (such that the URLs youuse will be rewritten into URLs that work), you can create aconfiguration section of the form:

Here we'll examine the git clone command in depth. git clone is a Git command line utility which is used to target an existing repository and create a clone, or copy of the target repository. In this page we'll discuss extended configuration options and common use cases of git clone. Some points we'll cover here are:

If a project has already been set up in a central repository, the git clone command is the most common way for users to obtain a development copy. Like git init, cloning is generally a one-time operation. Once a developer has obtained a working copy, all version control operations and collaborations are managed through their local repository.

As a convenience, cloning automatically creates a remote connection called "origin" pointing back to the original repository. This makes it very easy to interact with a central repository. This automatic connection is established by creating Git refs to the remote branch heads under refs/remotes/origin and by initializing remote.origin.url and remote.origin.fetch configuration variables.

An example demonstrating using git clone can be found on the setting up a repository guide. The example below demonstrates how to obtain a local copy of a central repository stored on a server accessible at example.com using the SSH username john:

The first command initializes a new Git repository in the my-project folder on your local machine and populates it with the contents of the central repository. Then, you can cd into the project and start editing files, committing snapshots, and interacting with other repositories. Also note that the .git extension is omitted from the cloned repository. This reflects the non-bare status of the local copy.

The -branch argument lets you specify a specific branch to clone instead of the branch the remote HEAD is pointing to, usually the main branch. In addition you can pass a tag instead of branch for the same effect.

Similar to git init --bare, when the -bare argument is passed to git clone, a copy of the remote repository will be made with an omitted working directory. This means that a repository will be set up with the history of the project that can be pushed and pulled from, but cannot be edited directly. In addition, no remote branches for the repo will be configured with the -bare repository. Like git init --bare, this is used to create a hosted repository that developers will not edit directly.

Reply all
Reply to author
Forward
0 new messages