Questions tagged [git-clone]

Obtains a local copy of a remote Git repository.

1359 questions
42
votes
1 answer

Cloning git repository from svn repository, results in file-less, remote-branch-less git repo

Working SVN repo I'm starting a git repo to interact with a svn repo. The svn repository is set and working fine, with a single commit of a basic README file in it. Checking it out works fine: tchalvak:~/test/svn-test$ svn checkout…
Kzqai
  • 22,588
  • 25
  • 105
  • 137
41
votes
4 answers

Why Isn't There A Git Clone Specific Commit Option?

In light of a recent question on SO, I am wondering why isn't there an option in git clone such that the HEAD pointer of the newly created branch will point to a specified commit? In say question above, OP is trying to provide instructions on the…
ivan.sim
  • 8,972
  • 8
  • 47
  • 63
41
votes
5 answers

git hooks : is there a clone hook?

We want to store some meta-information about the commit in an external database. During a clone or a checkout, this database should be referred and we copy the meta information to a file in the repo which is cloned. The database is required rather…
maxmelbin
  • 2,045
  • 3
  • 21
  • 29
40
votes
3 answers

git gui: how to clone and push?

I think I am stupid. I don't understand how Git works with the command lines so I am using Git Gui. I got it install and the Gui can be launched successfully, but when I come to clone the file from the files which is shared by another programmer…
Run
  • 54,938
  • 169
  • 450
  • 748
40
votes
7 answers

Git clone: Redirect stderr to stdout but keep errors being written to stderr

git clone writes its output to stderr as documented here. I can redirect this with the following command: git clone https://myrepo c:\repo 2>&1 But this will redirect all output, including errors, from stderrto stdout. Is there a way to redirect…
Pascal Berger
  • 4,262
  • 2
  • 30
  • 54
40
votes
2 answers

git-clone and post-checkout hook

According to the manual, the post-checkout hook is run after a git checkout (just as expected) but also after a git clone (unless you pass --no-checkout). Very well, now, considering the following: you don't have a local repository before a git…
Geoffrey Bachelet
  • 4,047
  • 2
  • 21
  • 17
39
votes
2 answers

What does "Filtering content" mean when doing a git clone?

I cloned a git repo and noticed a status line Filtering content which was very slow. This doesn't usually appear. What is it? remote: Enumerating objects: 30, done. remote: Counting objects: 100% (30/30), done. remote: Compressing objects: 100%…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
37
votes
6 answers

git - getting ALL previous version of a specific file/folder

I want to retrieve all previous version of a specific file in a git repository. I see it is possible to get one specific version with the checkout command, but I want them all. And the git clone command with the depth option doesn't seem to allow me…
max152
  • 505
  • 1
  • 4
  • 6
36
votes
6 answers

What is my bottleneck when cloning a git repository from a virtual machine with a fast network connection?

I have a situation with a relatively large git repository located in a virtual machine on an elderly, slow host on my local network where it takes quite a while to do the initial clone. ravn@bamboo:~/git$ git clone gitosis@gitbox:git00 Initialized…
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
36
votes
15 answers

Clone multiple git repositories in one local directory?

Is it possible to git clone multiple git repositories with one command (for example: git clone "1.git,2.git,3.git.." in one local directory?
vir2al
  • 817
  • 4
  • 11
  • 15
36
votes
2 answers

Why do I see a deleted remote branch?

I have a remote repository and 2 clones. I create a branch in one of the clones e.g. test. I do some work and 2 commits. I merge to master branch and push -u the branch. I do a git pull in the other clone. I see both master and test. In the first…
Cratylus
  • 52,998
  • 69
  • 209
  • 339
35
votes
5 answers

Cloning a repository without making it the origin remote

I'm cloning a git repository from a computer that's going to be wiped. Is it possible to clone a repository without making the original repository origin/master? Or do I need to clone it, and then delete the remote branch (which is done with git…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
34
votes
6 answers

How do I clone a large Git repository on an unreliable connection?

I want to clone LibreOffice. From the official website, this is what's written: All our source code is hosted in git: Clone: $ git clone git://anongit.freedesktop.org/libreoffice/core # (browse) Clone (http): $ git clone…
khunshan
  • 2,662
  • 4
  • 28
  • 34
33
votes
5 answers

the git clone is empty? why this happens

This always perplexes me. I was cloning this git clone https://android.googlesource.com/kernel/msm.git And It seemed to be cloning resolving and receiving objects etc for long . Then when it is done... git clone…
sraddhaj
  • 581
  • 1
  • 7
  • 17
33
votes
6 answers

Progress indicator for git clone

Is it possible to get a progress bar when doing a git clone? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.
Olivier Lalonde
  • 19,423
  • 28
  • 76
  • 91