NotationMaster
NotationMaster

Reputation: 410

Setting up Git via Terminal on macOS High Sierra

I am learning Git via the Pro Git book.
To begin setup it tells to open Terminal and execute git init on the project I want to start revisioning.

Problem is: this command successfully creates a .git hidden folder only if I execute it in my home directory (\Users\<username>).

If I drag the needed folder into Terminal and write git init I get the error: is a directory.
What does that mean?
I have read plenty of guides and no one seems to help me.

How do I setup Git via Terminal in a successful way? The linked questions' instructions didn't help.

Upvotes: 0

Views: 54

Answers (1)

Ren&#233; H&#246;hle
Ren&#233; H&#246;hle

Reputation: 27325

git init create a project in that folder you're in. So create a new folder first and change in that folder.

mkdir test
cd test
git init

You can find it in the documentation in the last example:

https://git-scm.com/docs/git-init

Upvotes: 3

Related Questions