34

I'm pretty new to git. For a class the teacher posted a link to clone a project file it said

git clone git://github.com/foo

I typed the command and it seemed to work. Problem is I don't know where the file is! If I type the command again it says destination path already exists and is not an empty directory.

Any help really appreciated =S

bb2
  • 2,872
  • 7
  • 37
  • 45

5 Answers5

28

The repository should have been cloned into a directory named "foo" located in whichever directory you ran the git clone command from.

jwodder
  • 54,758
  • 12
  • 108
  • 124
7

It would be in a folder named foo

Generally, do

git clone git://github.com/foo .

Note the . in the end. You will get the repo in the current folder.

Or explicitly specify the folder:

git clone git://github.com/foo foo.clone
manojlds
  • 290,304
  • 63
  • 469
  • 417
1

This depends on where you are running this from. like for "foo"

root@EPUMBI:~# git clone https://github.com/epumbi/hacking.git

Just to know where you are from the place you are initiating the command type the following;

root@EPUMBI:~# pwd

/root

So from the above after typing pwd which is print working directory, it tells you that you are on the root directory.

Then to see your files downloaded like the above, you can use ls to view the files on the root directory/folder, then type the following to get into the directory so that you can execute the program.

root@EPUMBI:~# cd hacking

Don't forget to change the permissions to allow the file to be executable by doing the following command;

root@EPUMBI:~# chmod +x ./install.sh

I Am running the cmd in root mode so you can use sudo chmod +x ./install.sh Hope it helps!

Ezra A.Mosomi
  • 511
  • 5
  • 4
0

If you are using a Windows machine, check the 'HomeDrive' and 'HomePath' environmental variables. Running the Git Bash from the Start menu seems to set the default path to the '%HOMEDRIVE%%HOMEPATH%' location which are set via environmental variables. A list of these variables can be obtained by running a command prompt and running the command 'SET'.

yougotiger
  • 434
  • 4
  • 18
0

For my Git settings, the default folder (that wasn't stated in the Bash window) was my user directory. There it creates the clone and you can find your "foo" folder unless you change the destination, where you're running your bash from. Just an example, if you run:

cd D:\Soft\

and run your clone command after that, then your foo folder will be cloned to Soft folder on D:

Kartikey
  • 4,516
  • 4
  • 15
  • 40