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 trialEmmanuele Massimi
7,420 PointsGit add FILE && git commit vs git commit -a
Hi,
I'm a bit confused in regards of the difference between:
git add FILE1.md
git add FILE2.md
git commit -m "some comment"
And:
git commit -a -m "some comment"
Are these two commands achieving the exact same result, or is there any difference? In short, is the "-a" flag just a shortcut for adding all files while committing?
Thank you.
1 Answer
Michael Hulet
47,913 PointsYou'd be right about your last statement. git commit -a
commits all the changes that git finds automatically, whereas git add
ing specific files and then commit
ting allows you to choose exactly which files you want to commit
, and which ones you don't
Emmanuele Massimi
7,420 PointsEmmanuele Massimi
7,420 PointsThanks a lot, this clarifies everything for me.