CREATING A FOLDER USING GIT BASH AND PUSHING IT TO GITHUB
Tags: devops, git, cloud, github
Published: 2024-06-20 14:34:52

Git is a distribution version control system that multiple developers use to work on a project.

GitHub is a cloud platform that uses Git as its core technology.
To create a code and push it to GitHub using Git bash. Here is a step-by-step process.

1. Open your git bash terminal and enter your details using 
   the following commands
   git config --global user.name "your username"
   git config --global user.email "your GitHub email"
2. cd ~ and create a directory (folder) using the command 
   mkdir
   mkdir "directory name" 
3. Enter into the directory you create using the cd command 
   cd "directory name"
4. Then initialize your master branch by running the command  
   git  init
5. Create a file name index.html by running the command
   touch index.html
6. To input the html code in the file run the command 
   vi index.html, a new page will open, paste the code you 
   have copied or write your own code and exit with the 
   escape (esc) botton, save and quit the command :wq
7. To check the content of the file run the cat command
   cat index.html
8. Open your GitHub account on a browser in order to create 
   a repository.
9. Click on the icon that has your profile picture and click 
   on repository.
10. Click on New and give your repository a name, make sure 
    it is Public. check the Readme box and click on create 
    repository
11.Once is done you will see a green icon with the name 
   Code, click on it and copy the https URL.
12. Go back to Git bash and run the command
    git remote add origin " paste the URL" you copied, and 
    press enter.
13. To add your code on run the command 
    git add index.html.
14. To check if the file was actually added in your git run 
    the command
    git status
15. Now let's add a commit message using the command
    git commit -m " add any message of your choice", check 
    the status again 
16.Next input the major command to push your code, run the 
   command
   git push origin master and press enter. 
17.Now let's go to GitHub to see if truly we have 
   successfully pushed. Click on the repository you created.
18. Next click on main, and then click on master branch, you  
   see the index.html, click on it to see the code you 
   pushed.
Attached is the screenshot of the above steps.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krgaxd3mo17qq2d7phkb.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69kwx9kvb6lvqx7yr041.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjsht894gfbri76j245b.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ld5jlvmofeos972ntrd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7u7b849zbpe5cxdhohxz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlpee1c34frw70e4zrnr.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mh3n33msl39ax4znl88q.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tbbs4o7q2wtvd6n8iehy.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mwmgh6m01il7m11uv1n.png)