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 trialWillemijn B
5,577 PointsWhere to see the working directory files
In this video Jay shows how one file seems to 'disappear' when checking out to the master branch. Where would I find this overview of files in the folder when I'm using Git in my Terminal (on Mac)? Would this be visible in a code editor like Atom the same way it is in Workspaces, or should I find it somewhere else?
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHi Willemijn B
The 'working directory' you're seeing in the video isn't actually a file directory of a folder. It is the side bar of his Text Editor that is showing the file tree of the project being worked on.
If you were to just show your folder contents on the desktop or run the list in the terminal as Jamie said, you will see all the files for the project regardless of which branch you are on. The files will only disappear and re-appear in the file tree within the Editor you are using to code (e.g Atom, VS Code, Sublime, etc).
I hope this clears it up some.
:)
Jamie Reardon
Treehouse Project ReviewerYou can run the command -ls to show the contents of a directory. Hidden files will be ignored however, you may pass the command option -a or --all to include hidden files, they begin with a ".".
Willemijn B
5,577 PointsOh yeah I understand that, thanks though! I meant the folder view, in the GUI of his MacBook. I realize my question was phrased vaguely :)
Willemijn B
5,577 PointsWillemijn B
5,577 PointsIt does, thank you! It just didn't look like any text editor I know - then again maybe I'm just too used to dark mode ;)
Brendan Boyle
18,233 PointsBrendan Boyle
18,233 PointsHi Jason and Willemijin
I'm not sure if the way that Git functions has changed since these comments were posted but I am experiencing the exact opposite of this. Switching between branches affects the folder view in my editor and the actual folder on my system.
It would appear that the working directory is the directory on my computer, which reflects the branch I am currently working on. If I checkout another branch the folder's contents change to reflect this. All the files for the project are not available regardless of which branch you are on, I don't see how version control could work if this were the case.
All the versions of the files are there, safely hidden away somewhere in the .git directory but only the files from the current branch are visible using a file explorer or
ls
in the terminal.Of course, I could be wrong about this, I had no idea what Git was a couple of days ago :-)