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 trialJUSANG YOU
7,857 PointsDifference between git add and git commit.
As far as I understand, "git add" commands makes changed file staging and "git commit" means final report like I changed something on specific file. right? Can we just do "git commit" without staing process?? If then, What type of problem can be caused?
JUSANG YOU
7,857 PointsThank you! Tony. It is been clear! :)
2 Answers
Andi Wilkinson
26,822 Pointsgit add adds a file to your project, git commit commits the changes to final you can also just use git commit -a use git status to check whats going on!
MUZ140970 Shaune Muringani
11,962 Pointsgit add you are putting sought changes into the staging area and git commit you are now effecting all the chenges rendered complete of a file in the targeted repository
Tony Brackins
28,766 PointsTony Brackins
28,766 PointsHey Jusang,
You're correct. Git add, adds the files to staging, to later be committed. These can both be done together if it's easier for you. Just use git commit -a