Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Problem to commit with git (nothing added to commit)

Hello,

I'm following the course about git and I have an issue. I'm running with windows 8. I have setup git, but when I try to commit my readme file, it doesn't work.

I have the error

'''Untracked files:

    README

nothing added to commit but untracked files present (use "git add" to track)'''

Which is very weird is that I have put "git add readme.txt" before ... Do you know what can be wrong ?

I have the feeling that if I was with a Mac it would be so much easier for these things ...

Thanks

3 Answers

Ok, I have found the issue few seconds after my post ...

Actually the command git add [file] is case sensitive. My file name is README.TXT so I have to write git add README.TXT instead of git add readme.txt ...

Sorry !

James Barnett
James Barnett
39,199 Points

In most OSes filenames are case-sensitive.

Chris Dziewa
Chris Dziewa
17,781 Points

It is because you haven't staged your files to be committed. You need to add the files that you want to be committed. Once you have, then you should be able to commit like normal. Do git status to view the changes needing to be modified. If you want to add everything in the current directory you can type git add .. The period selects the current folder but can also be replaced with a file name. Now run git status again to see that all of your changes have been added and are ready to be committed. Now you can commit with a message.

Easy to say. I have untracked files and don't know how to add them to my GIT repository. I have wasted so much time and cannot fin answer . What command should I use? btw I use command line on Ubuntu and I am new to this.

Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed)

css/
images/
index.html