Python for Entrepreneurs Transcripts
Chapter: Source Control and Git
Lecture: First time git configuration
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Now that we've downloaded and installed Git, we just need to perform a few first-time setup commands, in order to get things up and running.
0:08
Now you only need to run these commands once, so just keep that in mind, you don't need to do this every time you start out Git.
0:15
Back in the terminal, we can now work with Git. Let's run our first set of commands,
0:20
now we are going to use the "git config" command, there is a whole lot of options here, we are really just going to run four commands.
0:28
The first thing we want to do is set up our username, this is how it is going to identify us, who we are, this is our natural name.
0:36
So we'll type "git config" and we'll give it the --global, we're saying we're setting this up for all of Git on our system,
0:44
not just for a single project. So "git config --global user.name" and I am just going to give it my normal human name, Matt Makai.
0:56
Now if you don't get any output back, that's good, that means that everything went smoothly.
1:01
With the next command, we are going to set up our user email address, now this is super helpful when for example we commit code
1:09
and we are working on a large project, we are working on an open source project, maybe with people we don't necessarily know
1:14
and then they need to get in contact with us. Now on our own businesses that may not be a big deal,
1:20
but if you hire contractors, you are going to want to know who you should contact in case anything goes wrong.
1:26
So for this we are going to say "git config --global" again, "user" and instead of name we are going to say "user.email".
1:33
And in my case, this is just matthew.makai@gmail.com. Now again, no output is good, that means it's saved properly.
1:42
And we'll check it in just a moment; now the third thing we want to run, and this is optional, but I always set this, I set my editor,
1:51
now by default, typically Nano is the editor that pops up, but I use Vim.
1:56
And again, if you are using Sublime Text, what you can do on your own system is
2:00
set the path to the executable, so a little pop up with the Sublime Text editor whenever you need to commit some text
2:08
or you need to write some text that Git will interpret. We'll get into that a little bit later, but for right now,
2:13
we can set this up by saying "git config" again, "--global core.editor", and in my case again, I am going to press specify "vim".
2:23
OK, so we've got our three things set, we just want to double check that we've set them properly, we can say "git config" and then just list out.
2:32
Now in my case, user.name is Matt Makai, user.email is matthew.makai@gmail.com, and my core editor is Vim.
2:42
Obviously your setting is going to be depending upon what you set,
2:45
and again if it's a little bit confusing at this point, you don't have to worry about the editor,
2:49
but you should go ahead and set user.name and user.email. With those few settings out of the way, we're ready to get started and dive into using Git.