Beginner guide to GitHub

Step 1: Install git and create a GitHub account

The first two things you’ll want to do are to download and install git and create a free GitHub account on tour web browser. Configure your git bash by entering your email and user name as asked for when you run the application.

1: Create a local git repository

When creating a new project on your local machine using git, you’ll first create a new repository (or often, ‘repo’, for short).

2: Add a new file to the repo

Go ahead and add a new file to the project, using any text editor you like though I recommend one to use VS Code or running a touch command. `touch newfile.txt` just creates and saves a blank file named newfile.txt.

3: Create a commit

It’s time to create your first commit!

4:Create a new branch

Now say you want to make a new feature but are worried about making changes to the main project while developing the feature. This is where branches come in.

5: Push a branch to GitHub

Now we’ll push the commit in your branch to your new GitHub repo. This allows other people to see the changes you’ve made. If they’re approved by the repository’s owner, the changes can then be merged into the primary branch.

Photo by Headway on Unsplash



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store