before we start working with Github, that is, to start committing, pushing files or cloning, we need to tell git about ourselves. Git need to know who we are. We do that by use of git config command and then setting values for our email and user name. Assuming you have already installed Git into your windows machine, go to windows menu and look for ‘Git Bash’ from main menu and click it’s icon as shown.

Your Git command line should be like below when you first open it.

git config command
we then type the two Git config command to set email and password:


You should replace the email in double quotes with the email you used to register for github and replace “YourGutHubUserName” with your github username.
the –global is the flag used to show that the value we have set should be used for all our github repositories.
If we wish, we may set different values for different repositories.
After setting our identities with github, we will need a git repository to start working with. We can have at least two ways to do that:
- Use git init to start one from scratch or
- use git clone to setup a repository we have already created in our local machine or somewhere else
creating a directory
In this lesson, we are creating our repository from scratch. Let us create a directory which we will be using in this course. we will use a ‘mkdir’ command followed by the name of the directory.

we have then used the command ‘cd’ and then the name of the directory to move to the new created directory so as to have the following window

git init command
running ‘git init’ command initializes empty repository in the current directory. A message is returned mentioning a directory called .git.
to confirm that we have created the directory, we use the ls -la command that causes the files created with the directory to be listed.

ls -l .git/
we can also use the ‘ls -l .git/’ command to see the many things our directory contains as shown:

git directory can be thought of as a database in your git directory that stores changes and change history of your project. Anytime you clone a directory, the directory is copied into your computer.
Every time you run a git init, a new directory is intialized.
Area outside git directory is the working tree. Working tree is the conversion of your project. It can be thought of as a work bench or sandbox where you perform all the modifications you want on your file. This working tree will contain all the files being tracked by the git and any new file we have not yet added to list branch file.
Our tree file is empty, and so we need to put some file in it. we copy a certain file from my computer by opening it’s location and then copying its address bar as shown.
copying a file to the new directory

please note that the backward slashes(\) in the file path must be changed manually each to forward slashes (/) for the copying to be successful, otherwise you will get an error.
we have now copied our file to the new current directory. Note the . at the end of the path statement.
ls -l command

The above statement after ‘ls -l’ command shows we have just copied the file to the directory.
We have now our file in the working tree but it is not being tracked by Git.
To make the git start tracking the file we add it to the project using ‘git add’ command passing the file as a parameter.

Now we have added our file to the staging area
Staging area
A staging area also known as the index is a file maintained by Git that contains all of the information about about what files and changes are going to go into your next commit.
git status command
we can use ‘git status’ command to get some information about the current tree and the impending changes.

our new file is labelled “to be committed”. This indicates that changes we have made to the file are currently in the staging area.
git commit command
To make our file to be committed, we run ‘git commit’ command.

The above command will prompt opening of our default editor where we should type a commit message(comment) and then save the opened file before closing it. The bash window above shows the words “waiting for your editor to close the file” as it has paused commit execution process in order to allow you edit the file commit message.
Note that in our lessons on installing Git, we choose vsCode as the default editor, and so it has opened.

After we commit successfully, we get the following message.

We have now successfully made a git commit. You may want to type ‘git status’ to see the current tree status.
Related Topics
- Version Control
- Getting started with Git
- Installing git on windows
- Basic Git Configuration
- Managing historical files
- Python Reserved words
- Introduction to html
- Creating a web page
- Getting started with python
- Artificial Intelligence Vocabulary
- sets

