Viewers: in countries Watching now:
The course shows how to use Git, the popular open-source version control software, to manage changes to source code and text files. Using a step-by-step approach, author Kevin Skoglund presents the commands that enable efficient code management and reveals the fundamental concepts behind version control systems and the Git architecture. Discover how to track changes to files in a repository, review previous edits, and compare versions of a file; create branches to test new ideas without altering the main project; and merge those changes into the project if they work out. The course begins by demonstrating version control in a single-user, standalone context, before exploring how remote repositories allow users to collaborate on projects effectively.
To finish up our discussion of how we can undo changes that we've made, I want to look at a relatively simple one which is how we can remove untracked files from our working directory. The idea is that if we have a lot of files that have been added to our working directory that are not tracked that we don't want, we just want to get rid of them, is there an easy way that we can do that? We certainly could go through and just delete them one by one, but Git gives us a quick and easy way to just tell all those files that should be thrown away. So specially if you have things like log files, zipped directories, compiled code, things like that that you don't want in your Repo, and you'd like to get them out of your working directory too.
We can get rid all of those by using the git clean command. Let's start by just creating some simple files. So we'll go into TextMate, and let's just make a new file, put Junk in it, and we'll save it, and we'll call it junk1, we'll put on the Desktop and then let's do a Save As, and we're going to call this one junk2, and then let's do Save As one more time, make this one junk3. So we'll close that up. We've now got these three junk files, we're going to add all of these to our working directory. So now when I do git status you'll see that they show up there as untracked files.
What we want to do is get rid of them. And the way that we just say throw them away is with git clean, and git clean on its own won't actually do anything. They will come and say you know what I need either a -n or a -f option. -n is a test run, so let's try that first, git clean -n, and it comes up and it says would not remove the folder explorers. Don't worry about that, we'll talk more about directories later. It says that it would remove junk1.txt, junk2, and junk3.txt, so it tells us the files that it would remove. That's what the -n option does.
git clean -f forces it to run, and essentially we have to add this extra flag to it because it is going to be destructive, it is going to throw away anything that is not in our repository. However, if we have something in our staging directory, junk1.txt like that, now if we run git clean -f, it did remove junk2 and junk3, but it did not remove junk1.
Junk1 is in our staging index, not in our working directory, so it didn't get thrown out. git reset HEAD on junk1.txt, now if we do git clean with the -f option, it throws it away as well, git status is empty. And we take a look, and we can see that all three of those files have been thrown away. So git clean is pretty simple, especially compared with all the work that we were doing with different kinds of resets. It has one simple purpose, which is just to throw away the untracked files.
Now be careful when using it, because of course it does destructively throw away these files. They're not stored in our Repo, they're not stored in our staging index. If we throw them out of the working directory, they're not stored there either, and they're not stored in your trashcan, they're just going to be permanently deleted.
Find answers to the most frequently asked questions about Git Essential Training .
Here are the FAQs that matched your search "" :
1. To add "-mmacosx-version-min=10.6" as described here:https://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10https://stackoverflow.com/questions/10177038/illegal-instruction-4-shows-up-in-os-x-lion
2. Or to use the version of git that comes with Xcode, or to use homebrew to install git instead.http://superuser.com/questions/697144/installed-git-not-sure-how-to-get-it-working
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.