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 Git Basics Merging Merge Conflicts

Max Pedersen
Max Pedersen
7,196 Points

Can you combine flags using Git?

Tommy has used "-a -m" separately in his commits in his past few videos. Are you allowed to combine these two flags into "-am"? It seems to work in the Treehouse Console, but I'm curious if there is a reason why I shouldn't combine them.

Roger Nordqvist
Roger Nordqvist
7,007 Points

Hi Max ...

I am used to -am to. It is now difference, But in the assignments here at treehouse, you cant put them together. I tried and got "wrong answer" :)

Yes, you can combine them. "-am" for commits is common. It is wise, however, to make sure you want to add all the files in the directory before your commit.

1 Answer

Andi Wilkinson
Andi Wilkinson
26,822 Points

you seem to be able to - New to GIt but adding git commit -a -m "message" is combining two flags