Initialize a Git repository trouble?


When I enter the command “git add README.txt”, this message appears, “fatal: not a git repository (or any of the parent directories): .git”. I am confused because I made the file already using the echo command, “echo “Hello Git and GitHub” >> README.txt”. Been stuck on this for days now. Can anyone help me with this?



the problem isn’t that the README.txt doesn’t exist, the problem is that commands (git add) can only be done if a git repository is initialized, which judging by the error isn’t the case

initializing a git repository (git init) creates a .git directory, could be a glitch in the lesson? You could initialize the repository again?


Thanks for replying. I just initialized it again and added it to the staging area, and got this message, “warning: LF will be replaced by CRLF in README.txt.
The file will have its original line endings in your working directory” am I all set to commit now?


funny enough, i recently got this error message in one of my own projects, haven’t gotten to the bottom of it, seems to have to do with line/file ending, you can ignore it for now and commit


Set git’s core.autocrlf to true on windows to convert when checking in/out.