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

Ruby

Ruby - "Git add ." doesn't work

Hi everyone, this may seem silly but i'm on the video 'push to github' and in the first minute i am asked to type "git add ." but the cmd screen doesnt move, it just sits there.

is this expected? or is it bcos i am on windows ? or...

thanks heaps :)

1 Answer

Damion McDunn
Damion McDunn
2,758 Points

(I haven't seen the vid, but yes, thats normal)

git add . adds the file (or with the ".", all updated files) to the stage. Think of it like gathering the files together that you want to move to the repository. Next, you need to actually commit them, which kind of checks-in your change set. to do so, use git commit -m "include a short note of what you did here between quotes"

then do your git push origin master to send your change set (your commit) to github.

good luck.

ps if you want to see the difference before and after the add ., use git status before you add something, then after, and you'll see the console say "changes not staged for commit", then after you add, it will say "changes to be committed". That's how you know your add worked.