In this episode, we're going to create our first local version control repository for our SQL projects and then connect it to a remote repository on GitHub.
Check the configured name of a user
$ git config user.name
Check the configured email address
$ git config user.email
Create a directory
$ mkdir sql
Enter into the directory
$ cd sql
Create a README file and add text to it
echo "Name: Kudzai Nyandoro > Project: SQL with PostgreSQL > Email: firstname.lastname@example.org" > README.md
Initialize the git repository
$ git init
Add all changes to git
$ git add -A
Commit all changes to git
$ git commit -m "Initial commit"
Create a new remote repository (See episode #9 for more)
Copy the needed text which you'll use below (See episode #9 for more)
Connect your local repository to your remote repository. This is what mine looks like.
$ git remote add origin https://github.com/kode47/sql.git
Push the master branch of your project to GitHub
$ git push -u origin master