Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

When committing all of the changes to the repository, "git commit -a" does not work.

I have tried so many different combinations when committing to the repository. I have tried all the git commit and git add with no luck.

1 Answer

So, there are a few things that need to happen first.

You of course need an initialised Git repository (run git init in the root folder of your project).

Second, git commit -a will only add tracked files (ones that Git already knows about).

Try git add path/to/files or git add . to add everything matching the paths or in the second case, everything from the current directory (should again be the project root folder).

After that, it should say that they are tracked files, and you can commit as you please.