Mac Hdd Clone

0 views
Skip to first unread message

Skye Severy

unread,
Aug 4, 2024, 8:41:54 PM8/4/24
to romalihan
Afterthe 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:


You can clone a repository from GitHub.com to your local computer, or to a codespace, to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from GitHub.com to your local machine, or to a remote virtual machine when you create a codespace. For more information about cloning to a codespace, see "Creating a codespace for a repository."


You can clone a repository from GitHub.com to your local computer to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from GitHub.com to your local machine.


Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on GitHub.com, or pull other people's changes from GitHub.com. For more information, see "Using Git".


To clone a repository locally, use the repo clone subcommand. Replace the repository parameter with the repository name. For example, octo-org/octo-repo, monalisa/octo-repo, or octo-repo. If the OWNER/ portion of the OWNER/REPO repository argument is omitted, it defaults to the name of the authenticating user.


To clone your repository using the command line using HTTPS, under "Quick setup", click . To clone the repository using an SSH key, including a certificate issued by your organization's SSH certificate authority, click SSH, then click .


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:

3a8082e126
Reply all
Reply to author
Forward
0 new messages