Understanding git init

https://www.codecademy.com/courses/learn-git/lessons/git-workflow/exercises/git-init?action=lesson_resume

My code works. However, how did bash know to use the link it chose. How did it know to create the empty git repository in sorcerers-code? I have done the command line course, so it seems like there should be something done to get me to this file before I init?

Not going to put in a screen shot as this is all the code that is there…

$ git init
Initialized empty Git repository in /home/ccuser/workspace/sorcerers-code/.git/
$

The environment that git is executed in contains information about what the current directory is, which is where git init will create the new repository (unless another location is specified)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.