Really getting stuck on this one. I've googled a lot and can't figure out what I've done wrong...
I'm trying to create a new file, via the git add README.txt
command in terminal...
(So far I've created a new folder Fundamentals
. Created a sub-folder git-practice
. And created a git repo via git init
command)
However, when I try and add a file in fundamentals/git-practice
, i get the following error..
fatal: pathspec 'README.txt' did not match any files
Not sure what I'm doing wrong.. everything seems to make sense. Here's the code:
Reenas-MBP:~ reenaverma$ cd ~
Reenas-MBP:~ reenaverma$ ls
72.png GitHub flask-workshop
Applications Library fundamentals
Creative Cloud Files Movies funny_things
Desktop Music get-pip.py
Documents Pictures world
Downloads Public wwlc
Dropbox Retrieved Contents
Reenas-MBP:~ reenaverma$ cd fundamentals
Reenas-MBP:fundamentals reenaverma$ ls
git-practice
Reenas-MBP:fundamentals reenaverma$ cd git-practice
Reenas-MBP:git-practice reenaverma$ ls -a
. .. .git
Reenas-MBP:git-practice reenaverma$ pwd
/Users/reenaverma/fundamentals/git-practice
Reenas-MBP:git-practice reenaverma$ git add README.txt
fatal: pathspec 'README.txt' did not match any files
Reenas-MBP:git-practice reenaverma$
I'm trying to create a new file, via the 'git add README.txt' command in terminal...
git add
does not create a new file. It adds an existing file to be indexed by git. You'll need to create the file first.
Just type in your terminal (e.g. in git bash):
git >> README.md
git add README.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With