Initialize a local directory as a Git repository and add it to Github Part 3 – Initialize the local directory as a Git repository

In the local folder use Git bash and initialize the folder.

git init -b main

Now go ahead and create a README.md file, add and stage the files and commit the changes to prepare to push to the remote repository.

echo "# itseasyasonetwothree" >> README.md
git add README.md
git commit -m "First commit"

Now next time we’ll add our remote repository and push the changes.

Initialize a local directory as a Git repository and add it to Github Part 1 – Download Git and create the directory

Let’s add source control to a local directory with Github like here.

First download Git from here.

Next launch Git Bash.

Now create a new folder for your project and move into the folder.

mkdir itseasyasonetwothree
cd itseasyasonetwothree/

Great! Now in the next post we’ll create our Github repository.