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.
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.
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.
Step 4: Accessing and initializing the new created directory.
Step 5: Create a file inside the directory using the touch command.
Step 6: Go to your browser, visit https://github.com/, and create a GitHub account.
Step 7: On the GitHub Dashboard, click the + sign, then select New repository from the drop-down menu.
Step 8: Enter the required details (name, description, license etc.), then click Create repository.
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.
Step 9: To clone the GitHub repository to your local environment, go to Git Bash and paste the copied HTTP address.
Step 10: To edit a text file, type vim
followed by the file name, then press Enter.
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) _
Step 11: To check the status, you press the command (Git status) enter in the Git bash.
Step 12: Adding the changes made in the documents to the staging area.(git + add + name of the text file)
Step 13: Take a snapshot of the entire file using git commit _-m_ **message
**.
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.
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.
Step 16: After activating Compare and push, the code file pushed be displayed
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)
CONGRATULATIONS: _Your Git credentials have been pushed successfully.
_
Top comments (0)