Start learning with our library of video tutorials taught by experts. Get started
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.
In the last movie, we initialized Git with our first_git_project. I want us to look at what that did and also understand where Git stores the files that it uses to do version control on our project. You can see that I have got the first_git_project directory open here in the Finder, and you can see that it's empty, actually it appears to be empty, it's not in fact empty. If we come to the command line, I can use the UNIX ls command to list what's in that directory, you can see that that's empty, on Windows that would be the dir command. I can pass in a special option here which is -la, and that will show me the hidden dot files as well, and that's any file that has a dot in front of it is normally going to be hidden.
So .git is a directory that is created by that initialize command. And this directory is a directory where Git stores all of its tracking information. Now that's all of its tracking information, it doesn't matter how deep down in other folders that we've got files going on, they are always going to be stored at the top level of our project inside this .git directory. You can think of it as Git's workspace where Git does everything that it's going to do, and if we wanted to remove Git and remove version control from our project, well, then it would just be a simple matter of removing this .git directory.
If we remove that, then suddenly Git is no longer tracking our project. Obviously, we don't want to do that at this point. Let's take a look at what's inside that directory, ls -la .git, and we can see a list of the files and folders that Git uses while it's doing its tracking. Now again this is Git's workspace, you don't want to come in here and start messing around and changing things, leave it alone, let Git manage these files and let it put things where they need to be. The only exception to that would be the config file, that's the only thing that you would really ever come in here and either take a look at or even possibly edit.
This is for our project level configuration. Now we have an interface through Git that we saw in the Configuration chapter where we don't have to come in here and edit it directly, you can just use git commands to set the different values that you need. But if you did ever need to, that's where this file is located. Everything else, you want to leave alone. Now again, I want to just emphasize the point that everything that Git does is going to be stored in this single top-level directory, that's very different from svn. If you've worked with svn before, svn puts little tracking files in every single directory down the line.
So if you wanted to remove svn, you have to go through and actually pull out those .svn files from every single directory so that it will stop tracking those. Git doesn't do that, Git puts them all right here in one place at the top level. Now that we understand where Git maintains information about our project, let's go ahead and create our first commit so that git can start tracking things inside of our project.
Find answers to the most frequently asked questions about Git Essential Training.
Here are the FAQs that matched your search "":
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.