Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now that we have initialized our project, we are ready to make our first commit that is to tell Git to track the first change. So we need to do something to our project, to make a change so that it can track it. So what we are going to do to start with is create a new file. So I am going to do that using TextMate, you can use any text editor--again that's a basic text editor, not a word processor to do this. So I'll open up TextMate, and I am just going to create a new file, I am going to say, This is my first file, and then I am going to choose Save, and then I'll just call it first_file.txt, and I'll just put it on the Desktop for now. All right.
So now I've got this first file, I am going to move it in my project, so there it is. Now I have made a change to my project, I have added a file, that's the change that's been made. So now what I want to do is switch over to the command line and tell Git to add all changes that have been made to this entire project, everything that's been made, and I do that with the dot, dot is short for, this directory. I am already inside my project directory first_git_project, so git add every change that's been made inside this directory, and now, I am going to commit that change, tell Git to put it in permanent memory, to put it in the repository. So git commit, and then I am going to give it a message, -m and in quotes I am going to put "Initial commit".
Now I could put something more specific in there, but this is going to be good enough to get us started, this is just a simple message telling it that it's going to make this commit, and you can see that it did one file change, one insertion, create mode, first_file, so now it has added that to our project. Now we have just tracked our first change in Git. So this is the basic process that we are going to follow throughout working with Git. It's really quite simple, you just make your changes, then you add the changes, and then you commit the changes to the repository with a message, and that's it. That's really the basic cycle that we are going to be following, make changes, add the changes, commit the changes.
Now of course, there is a lot more going on with each one of these steps and a lot of options and other things that we can do, but this is the basic flow of making commits that we are going to be doing over and over and over.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98207 Viewers
61 Video lessons · 85506 Viewers
71 Video lessons · 69469 Viewers
56 Video lessons · 101807 Viewers
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.
Your file was successfully uploaded.