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 trialramseydennis
4,530 PointsHow does Github detect the copyright edit that Dave makes on his text editor?
Hey everyone,
I might've missed something here - but when Dave switches to his text editor at the 33 second mark, and adds the copyright to his code, how does Github automatically detect this and record the changes on GitHub Desktop?
Thanks in advance -
2 Answers
Kevin Korte
28,149 PointsThat's what git does, it's constantly watching for changes. It knows the status of all of the files as of the last commit, and as it sees changes happen it real time, it will update the desktop app. Running git status
in the console will show you the same results as they happen.
woodworth
Front End Web Development Techdegree Student 19,831 PointsI haven't used the GitHub desktop software in a while, but if I remember right, I think you can see changes if you have the GitHub desktop program open and are inside this program so not from your Safari browser. You will need to push up your code changes if you want them added to your online GitHub repo. Otherwise, they will only be saved on your computer.
Kevin mentions the console which is how I access GitHub. You need to be inside Terminal for macs, not sure what it is for PC. It's the command prompt area where you use UNIX commands to navigate around to your projects. If you are only using GitHub via the desktop friendly version, you won't see this. There is a whole other way to use git where you just type commands directly and push/pull code to/from GitHub via the console.
ramseydennis
4,530 Pointsramseydennis
4,530 PointsThanks Kevin,
So just to be clear - once you upload your code onto Github Desktop, it automatically finds this code within your hard drive?
Do you not at any point have to click an option to link this?
Also, what exactly do you mean by 'running git status in the console'? This might've been totally off - but I tried typing 'git status' in the Safari console but got a SyntaxError.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsI also do not use Github Desktop, but as I understand it, it's just a simple graphic user interface for git. My guess, is when you start a new project, and have it in Github desktop, it will using the
.git
folder to track changes. By default this folder is probably hidden from your view, as must times any folder that starts with a dot is hidden, but there are ways to show hidden folders on your operating system.How git actually tracks, I do not know. People smarter than me figured that out, but I do know git knows and any time what has changed since your last commit, and so it's not unfeasable that github desktop is updating as the git folder does.
It should only find code to the root folder is was initialized to. It's not going to look at your whole hard drive. But wherever you set up project, there would be a
.git
folder there, that and than everything "downstream" in the folder structure from that root folder would be tracked by git by default.And on the console, I may have jumped ahead. I use, and many do, use git in the console or terminal. I don't use, but once a long long time ago, github desktop.
You can interact with git in your console, when you are in the root projects folder where git was initialized, (where the
.git
folder is), you can run a lot of differentgit
commands,git status
is one of them I use a lot, which will tell you in the console, what files have changed, what files are tracked, and what files are untracked. If that's not very clear, keep doing the git courses here, and you will eventually get to where you use git in the command line or terminal.