irm
irm

Reputation: 4321

File not found on Git

I’m in the process of learning Git and also struggling with the Mac Terminal (I recently change OS)

I successfully installed Git in my computer and I was able to push my project to Github but now I’m not able to add the same file(index.html) I was working on to my next commit and get the fallowing error:

fatal: pathspec 'index.html' did not match any files

index.html is in the same folder so I must have changed the git setup but I don’t know how to reestablish what I had.

Is this something I can fix using git config, do I need to include the path to the file?

If I type git status , I get the following which isn't right.

On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   Documents/first_git_project/index.html
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .CFUserTextEncoding
#   .DS_Store
#   .Trash/
#   .bash_history
#   .bash_profile
#   .bashrc
#   .cups/
#   .git-completion.bash
#   .gitconfig
#   .npm/
#   .nvm/
#   .ssh/
#   .viminfo
#   Desktop/
#   Documents/.DS_Store
#   Documents/.localized
#   "Documents/I\342\200\231m in the process of learning Git and working with the Mac Terminal.docx"
#   Documents/Microsoft User Data/
#   Documents/RDC Connections/
#   Documents/Symfony_quick_tour_2.2.pdf
#   Documents/Terminal Cheatsheet for Mac.docx
#   Documents/first_git_project/ first_file.txt
#   Documents/first_git_project/.DS_Store
#   Documents/first_git_project/css/
#   Documents/first_git_project/fancybox/
#   Documents/first_git_project/font/
#   Documents/first_git_project/img/
#   Documents/first_git_project/imgs/
#   Documents/first_git_project/js/
#   Downloads/
#   Library/
#   Movies/
#   Music/
#   Pictures/
#   Projects/
#   Public/
#   SublimeProj/
#   kno-engage-ui/
no changes added to commit (use "git add" and/or "git commit -a")
isaiass-MacBook-Pro:~ isaias$ 

Upvotes: 0

Views: 6026

Answers (1)

CharlesB
CharlesB

Reputation: 90276

Git (as many other tools, indeed) excpect you to provide the right path:

git add Documents/first_git_project/index.html #if you're in the project root folder

Upvotes: 1

Related Questions