DEV Community

Cover image for Code On Gitbash- Push to Github
Tolulope Adeleke
Tolulope Adeleke

Posted on

Code On Gitbash- Push to Github

As a beginner it gets difficult to master Gitbash and push anything to Github even when this is a fundamental skill for a developer. This article will take you through every step till you push to Github.

Let's go through each step, as we code on Gitbash and push to Github.

Step 1:

If you haven't downloaded and Install Gitbash - Do so now!

Git Bash is an application for Microsoft Windows environments which provides an emulation layer for a Git command line experience.

You can download Gitbash here -

Step 2:

On Git Bash, set your username and email using the following commands:

git config — global “Your Name”
git config — global “”

Step 3:

Create a project directory

Image description

Step 4:

Now, change directory

Image description

Step 5:

Now start a Git repository

Run the command git init to create a new Git repository

Image description

Step 6:

Use touch index.html to create the index.html
Run vim index.html to edit

Image description

Step 7:

Connect to GitHub

Go to to your Github repository, create new repository, copy the http link and append it to the “git remote add origin” command.

Image description

Step 8: Stage Changes

Run command git add command to stage changes to the index.html file

Image description

Step 9: Commit Changes

Run git commit -m command to take a snapshot of your file. This makes the changes permanent.

Image description

Step 10: Now push to Github

Run command git pushto push the committed changes to the master branch on GitHub.

Image description

Well done ! You have successfully navigated the process of pushing changes from your local environment to GitHub.

Top comments (0)