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 user.name “Your Name”
git config — global user.email “your.email@example.com”
Step 3:
Create a project directory
Step 4:
Now, change directory
Step 5:
Now start a Git repository
Run the command git init
to create a new Git repository
Step 6:
Use touch index.html to create the index.html
Run vim index.html
to edit
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.
https://github.com/Tioluwaniope/Gittest101.git
Step 8: Stage Changes
Run command git add
command to stage changes to the index.html file
Step 9: Commit Changes
Run git commit -m
command to take a snapshot of your file. This makes the changes permanent.
Step 10: Now push to Github
Run command git push
to push the committed changes to the master branch on GitHub.
Well done ! You have successfully navigated the process of pushing changes from your local environment to GitHub.
Top comments (0)