Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancelled a git-clone, where are the downloaded files?

Tags:

git

I just cancelled a git-clone while it was receiving objects, using ^C on my Mac OSX 10.6.8. Git had already download 1.2GB, according to the "receiving objects" line. I'd like to remove these files, since that's a big chunk of memory, but I can't find them anywhere.

The folder I was cloning them to hadn't been created yet, and there is no obvious .git-xyz folder in the parent directory that could hold them.

Any thoughts? Or are they just in some OS-defined temporary folder and will get cleaned up automatically at some point?

like image 959
Sam Fen Avatar asked Apr 04 '13 14:04

Sam Fen


People also ask

Does git clone download deleted?

Once an item is in the git history, it is there permanently. Even if a later commit deletes the file, the file will still be present in a git clone because a git clone contains the full history (because Git is a distributed version control system).

Where do git clones download to?

The "clone" command downloads an existing Git repository to your local computer. You will then have a full-blown, local version of that Git repo and can start working on the project. Typically, the "original" repository is located on a remote server, often from a service like GitHub, Bitbucket, or GitLab).

Does git clone download all history?

No it does get the full history of the remote repository.

Does git clone download all branches?

git clone downloads all remote branches but still considers them "remote", even though the files are located in your new repository. There's one exception to this, which is that the cloning process creates a local branch called "master" from the remote branch called "master".

Why is Git not cloning my files?

If Git is not able to clone due to a weak connection, it would display a fatal error and the user is requested to try again until the above message does not appear. Confirm the cloning by listing the directories once again using the ls command which lists all the files and folder.

How to clone a git repository?

First of all, the git clone command is used to target an existing repository and clone or copy it in a new directory. A local copy stored on a server, that is accessible at example.com can be obtained using the SSH username x_person, like this:

What are the different types of Git clone arguments?

The most common ones are presented below: git clone -branch ¶ The -branch argument specifies a branch which should be cloned instead of the one the remote HEAD is... git clone --bare ¶ With the --bare argument passed to git clone, you will have a copy of the remote repo created with an... git clone ...

What does Git clone--bare mean?

git clone --bare ¶ With the --bare argument passed to git clone, you will have a copy of the remote repo created with an excluded working directory. So, the repository will be created with the project history which can be pushed or pulled from but cannot be edited. git clone --mirror ¶


1 Answers

as one of the commenters said, for a git clone git://foosite/fooproj, git will create a directory called fooproj/.git and download all the repo files into there.

the second stage of clone is a "checkout" of the origin/master branch usually, but since your ctrl-c was caught by the app, the directories were likely deleted, and no checkout was done.

i.e. if

$ ls -a fooproj

doesn't yield anything, then the files were already deleted.

like image 200
Jesse Brandeburg Avatar answered Oct 18 '22 14:10

Jesse Brandeburg