-1

I want to clone a project from github to my local created folder. However, when i execute "git clone" command i have below error.

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I execute "git init" command on that folder and this error disappear, but in the following path I must "add" and "commit" the added and committed remote repository again. This is what I do not want.

rlandster
  • 7,294
  • 14
  • 58
  • 96
m Siami
  • 11
  • 1

2 Answers2

1

The git clone command:

  1. Makes a new folder.
  2. In the new folder, runs git init and a whole series of additional Git commands. The clone is now in the new folder.

You, however, are not in the new folder. You are still in the same folder ("current working directory" is the more technical term for this) as you have been all along. You must move your own command-line interpreter into the new folder too, before you make use of the new clone.

torek
  • 448,244
  • 59
  • 642
  • 775
0

Another approach to git clone is to use the GitHub CLI gh.

Once installed, authenticate yourself with gh auth login, then create your new repository with gh repo clone, with a simplified URL "OWNER/REPO" instead of "https://github.com/OWNER/REPO":

# Cloning a repository
~/Projects$ gh repo clone cli/cli
Cloning into 'cli'...
~/Projects$ cd cli
~/Projects/cli$

Note that you still have to cd (change directory) into the cloned repository.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250