Questions tagged [git-clone]

Obtains a local copy of a remote Git repository.

1121 questions
112
votes
33 answers

How to clone all repos at once from GitHub?

I have a company GitHub account and I want to back up all of the repositories within, accounting for anything new that might get created for purposes of automation. I was hoping something like this: git clone git@github.com:company/*.git or…
numb3rs1x
  • 3,033
  • 5
  • 26
  • 36
109
votes
13 answers

"fatal: Not a git repository (or any of the parent directories)" from git status

This command works to get the files and compile them: git clone a-valid-git-url for example: git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts However, git status (or any other git command) then gives the above fatal: Not a git…
Kevin Kostlan
  • 2,817
  • 6
  • 25
  • 32
100
votes
13 answers

fatal: could not create work tree dir 'kivy'

I'm trying to clone my fork of the kivy git, but it's not working. I've made the fork correctly, I believe, but when I type this into my Mac terminal: git clone https://github.com/mygitusername/kivy.git I get this error: fatal: could not create…
AndroidDev
  • 18,031
  • 39
  • 126
  • 220
89
votes
1 answer

How do I shallow clone a repo on a specific branch?

How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone --depth 1 https://path/to/myrepo.git but not start the clone on a specific branch.
81
votes
3 answers

How to clone seed/kick-start project without the whole history?

Note that using --depth=1 parameter prevents you from pushing the project to a new repository.
itamar
  • 1,512
  • 4
  • 15
  • 29
75
votes
4 answers

Difference between git remote add and git clone

What does the clone command do? Is there any equivalent to it in svn? What is the difference between git remote add test git://github.com/user/test.git And git clone git://github.com/user/test.git Does the name of the created repo matter?
nacho4d
  • 39,335
  • 42
  • 151
  • 231
69
votes
4 answers

Retrospectively add --recursive to a git repo

If you git clone with --recursive, you can get all the git submodules too. If I've forgotten to add this magical flag when cloning, as can happen, how do I now go and get any submodules? Additionally, how can I set the recursive flag as a default…
kenneth
  • 973
  • 1
  • 7
  • 10
56
votes
5 answers

Git clone with custom SSH using GIT_SSH error

I am trying to clone a Git repo using a custom SSH command. I set the SSH command in the GIT_SSH environmental variably be running export GIT_SSH="/usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key". But when, after the previous…
Paris
  • 5,473
  • 7
  • 28
  • 43
55
votes
5 answers

Is it possible to find out the users who have checked out my project on GitHub?

I'm wondering if there is any way to know who has checked out my project hosted on GitHub? This would include people who have forked the project directly on GitHub, as well as people who may have cloned the repository using standard git clone…
user1998981
  • 605
  • 1
  • 5
  • 6
53
votes
5 answers

How to clone git repository from its zip

I'm trying to clone a remote repository on github, but it is big and my connection doesn't seem to be stable enough, so I can't clone it successfully. But I have successfully downloaded the .zip of the repository. Is there a way to use this zip as…
Lesto
  • 2,083
  • 2
  • 17
  • 25
52
votes
3 answers

How can I 'git clone' from another machine?

On one machine (IP address 192.168.1.2), I create a Git repository by $ cd /home/hap/working $ git init $ (add some files) $ git add . $ git commit -m 'Initial commit' And I have another machine on the same Wi-Fi network. How can I get clone from…
hap497
  • 129,793
  • 42
  • 77
  • 91
52
votes
1 answer

Why do some repository URLs end in .git while others don't?

When I clone a repository, is there any difference between these two URLs? Without .git extension: git clone http://foo/repo With .git extension: git clone http://foo/repo.git
user496949
  • 75,601
  • 138
  • 297
  • 413
50
votes
3 answers

Why can't I push from a shallow clone?

The git clone --depth command option says --depth Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor…
Philip Oakley
  • 11,745
  • 8
  • 42
  • 63
48
votes
1 answer

Explain clones info in Github's Traffic tab

In a recent question I made, one of the answers pointed to another answer in another question where a way to explore the forks and clones of a public Github repo was shared. I went ahead and did that with my own public repo and came up with this…
Gabriel
  • 32,750
  • 58
  • 187
  • 337
48
votes
5 answers

What determines default branch after "git clone"?

My understanding is that the default branch of a cloned repository is to be whatever HEAD points to in the repo being cloned. I now have a case where this is not true. My understanding is obviously flawed, so what does determine the default checkout…
Christian Goetze
  • 1,864
  • 2
  • 26
  • 46
1 2
3
74 75