aedf saef
aedf saef

Reputation: 29

which folder do I do a git init

My project folder is called c:\project\SampleApp, within SampleApp are all the files for my Android/Java project. I would like to start using git.

Do I change my directory and do a git init like this:

cd c:\project\SampleApp
git init

or do i do the following:

c:\project
git init

I tried to look through some documentation but it was not clear. I also tried to watch videos on this but that didn't help.

Therefore I just dont know if I must init the entire SampleApp, or if I must first enter it.

Upvotes: 1

Views: 335

Answers (1)

maja
maja

Reputation: 18044

If you're initialising a new repository, you have to enter the directory:

cd DirectoryName
git init

However, if you're cloning an existing project, the project folder will be generated automatically. Cloning an existing project doesn't require calling git init.

git clone therefore has to be called in the parent directory and will generate a new folder, containing the existing project.

Upvotes: 2

Related Questions