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

Don't get Git branches displayed in Finder?

Hi All,

When I created a repository with Git on my Mac the files showed up in Finder. Now I have created some branches but the files don't show up. Why is that?

Cheers.

Eric Amundson
Eric Amundson
19,530 Points

The files are there, but not stored separately. The git repo contains all of the differences between all branches and files and, when viewing a git repo in Finder, you'll simply see what is currently checked out.

Say you have two branches in a repo, each containing one file: branch one contains file-a.php and branch two only contains file-b.php,

If you were to use git to checkout branch one, then look at your repo in Finder, you'll see file-a.php (not file-b.php), but if you were to checkout branch two, you'll just see file-b.php (not file-a.php) in Finder.

The "missing" file doesn't go away when it isn't checked out, but Git stores it all in a format you can't drill down into with Finder alone.

Does that help?

Ricky Catron
Ricky Catron
13,023 Points

Eric can you please move this to an answer instead of a comment so that it can be marked as best answer, you can recieve points, and future students can find their solution easier.

All the best, --Ricky