Skip to main content

Posts

Showing posts with the label GitHub

GitHub Basics: Essential Commands

GitHub Basics: Essential Commands GitHub is a popular platform for version control, collaboration, and code sharing. It’s an essential tool for developers, enabling them to track changes, work together on projects, and manage their code effectively. Essential GitHub Commands Here are some fundamental Git commands and their uses: 1. Git Init: Purpose: Initializes a new Git repository in the current directory. Command: git init 2. Git Clone: Purpose: Clones an existing Git repository from a remote repository. Command: git clone [repository_url] 3. Git Add: Purpose: Adds changes to the staging area, preparing them for commit. Command: git add [file_name] or git add . (to add all changes) 4. Git Commit: Purpose: Commits changes from the staging area to the local repository. Command: git commit -m "[commit message]" 5. Git Push: Purpose: Pushes changes from the local repository to a remote repository. Command: git push origin [branch_name] 6...

How to Host Your Website on GitHub Pages: A Beginner's Guide

GitHub, primarily known as a code repository platform, offers a fantastic feature called GitHub Pages, allowing you to host static websites directly from your repositories. This means you can deploy your website without the need for a traditional web hosting provider. In this guide, will walk you through the steps of creating and hosting your own website on GitHub Pages. Prerequisites: A GitHub account Basic understanding of HTML, CSS, and JavaScript Step-by-Step Guide: Create a New Repository: Log in to your GitHub account and create a new repository. Name your repository with your username followed by .github.io . For example, if your username is "yourusername," the repository name should be "yourusername.github.io." Add Your Website Files: Create an index.html file as the main page of your website. Add any other necessary HTML, CSS, and JavaScript files to the repository. You can use a variety of tools like VS Code, Sublime Text, or online editor...