DEV Community

Cover image for HOW TO PUSH FROM LOCAL ENVIRONMENT TO GITHUB.
Godwin Oyindamola
Godwin Oyindamola

Posted on

3 1 1 1 1

HOW TO PUSH FROM LOCAL ENVIRONMENT TO GITHUB.

What is Git?
Git is a distributed version control system that helps developers track changes in their code and collaborate on projects.

What is GitHub?
GitHub is a code hosting platform that allows developers to collaborate on projects, manage their code, and track changes. It uses Git, a version control system, to provide a range of features that facilitate software development.

STEPS INVOLVED IN PUSHING LOCAL ENVIRONMENT TO GIHUB:

Step 1: Go to your browser, search for Git Bash, download Git, and install it.
Download

Step 2: In Git, configure the environment with your name and email, then press Enter to make sure its successfully done. The required commands are shown in the diagram below.
Config
NOTE: There should be a single space when typing the commands.

Step 3: Create a directory to store the project files. Give it a name of your choice. The command is shown in the diagram below.
directory

Step 4: Accessing and initializing the new created directory.
Access

Step 5: Create a file inside the directory using the touch command.
FILE

Step 6: Go to your browser, visit https://github.com/, and create a GitHub account.
Github

Step 7: On the GitHub Dashboard, click the + sign, then select New repository from the drop-down menu.
GitDash

Step 8: Enter the required details (name, description, license etc.), then click Create repository.
Create Repo

Step 9: After creating the repository, click the Code button, copy the HTTP address from the drop-down menu, and paste it into Git Bash.
Repo Acct

Step 9: To clone the GitHub repository to your local environment, go to Git Bash and paste the copied HTTP address.
Clone

Step 10: To edit a text file, type vim followed by the file name, then press Enter.

Image description

NOTE: Once the command is successful, a text page will be displayed.(To start typing, press "I" on your keyboard.)
_ESC (To exist insert mode, shft + colum, W (to save) Q ( quit and go back to normal terminal) _
Text page

saved text

Step 11: To check the status, you press the command (Git status) enter in the Git bash.
status checking

Step 12: Adding the changes made in the documents to the staging area.(git + add + name of the text file)
Addtion

Step 13: Take a snapshot of the entire file using git commit _-m_ **message**.
shot

Step 14: To push the file, use the command git push origin master. A login prompt for your GitHub profile will appear; log in, authorize and then return to Git Bash to confirm the successful push.

push

successful

Step 15: To find the code you pushed, go to your GitHub repo, click on your profile picture, and select Your repositories from the drop-down menu.
check repo

Step 16: After activating Compare and push, the code file pushed be displayed
repo code

Step 17: Go to Settings, set the "Branch" option under Pages to master, and click Save to generate a web page for your resume.
!web link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbnzvzlb2d2umujaflgy.png)
Web page

CONGRATULATIONS: _Your Git credentials have been pushed successfully.
_

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay