Git and GitHub – What is GitHub (Part-7)

What is GitHub?

GitHub is a web-based platform that uses Git for version control and offers features to facilitate collaboration on software development projects. It hosts your Git repositories and provides a user-friendly interface for managing your projects, collaborating with others, and tracking changes.

Key Features of GitHub:

  1. Repositories: Store your project files and version history.
  2. Branches: Allow you to work on different features or versions of a project simultaneously.
  3. Pull Requests: Facilitate code review and collaboration by proposing changes to be merged into the main project.
  4. Issues: Track bugs, enhancements, and tasks.
  5. Collaborators: Invite others to work on your project with different levels of access.
  6. GitHub Actions: Automate workflows, such as testing and deployment.

Simple Examples to Understand GitHub

Example 1: Creating a Repository

  1. Sign Up and Sign In:
    • Go to GitHub and sign up for an account if you don’t have one.
    • Sign in to your account.
  2. Create organization as free

Create a Repository:

  • Click on the “+” icon in the top right corner and select “New repository”.
  • Fill in the repository name (e.g., my-first-repo), description, and choose whether it will be public or private.
  • Click “Create repository”.

Clone Options:

  • HTTPS: This provides the URL to clone the repository using HTTPS.
  • SSH: This provides the URL to clone the repository using SSH.
  • Clone URL (Highlighted): git@git

you can push or clone from local machine to GitHub or Vice-versa via SSH or HTTPS

Initialize the Repository:

  • You can initialize the repository with a README file, which describes your project.

Clone the Repository:

  • On your local machine, open Git Bash (or any terminal) and run if want to do via Https
    git clone https://github.com/your-username/my-first-repo.git
    

    or via ssh you need to generate SSH Key-gen

    Summary of GitHub Workflow

    1. Creating a Repository: Set up a new project repository on GitHub.
    2. Cloning the Repository: Copy the repository to your local machine.
    3. Making Changes: Add, edit, or delete files in your project.
    4. Staging and Committing: Stage the changes and commit them with a message.
    5. Pushing Changes: Push the commits to the GitHub repository.
    6. Collaborating: Use branches and pull requests to collaborate on changes.
    7. Merging Changes: Merge pull requests after review and approval.

    Benefits of Using GitHub

    • Collaboration: Easy to collaborate with others, review code, and manage projects.
    • Version Control: Track changes and revert to previous versions if needed.
    • Project Management: Use issues, milestones, and project boards to manage tasks.
    • Integration: Integrate with various tools and services like CI/CD pipelines, project management tools, and more.

    Related Posts

    Git and GitHub – GitHub Overview (Part-15)

    1. Github Description: 2. Org (Organization) Description: Example: 3. Team Description: Example: 4. Auth (Authentication) Description: Examples: OAuth Authentication: Personal Access Tokens: SSH Key Authentication: 5. Action…

    Read More

    Git and GitHub – Git Log Explanation (Part-14)

    Git Log Explanation Explanation of Each Part 1. Commit Hash 2. References (Branches and Tags) 3. Commit Message Simplified Breakdown of Each Line Summary The git log…

    Read More

    Git and GitHub – Merge and Pull (Part-13)

    Merge and Pull in Git Merge Merge is a command used to combine the changes from one branch into another. It is typically used to integrate changes…

    Read More

    Git and GitHub – Types of branch (Part-12)

    Local and Remote Branches in Git Local Branch A local branch is a branch that exists in your local Git repository. You create and manage local branches…

    Read More

    Git and GitHub – Git Undoing, Conflict Resolution, Cherry Picking, Stash (Part-11)

    Undoing changes in Git can be approached in several ways, depending on what you need to achieve. Here, we’ll cover the most common scenarios and commands for…

    Read More

    Git and GitHub – Understanding Git Concepts (Part-10)

    Understanding Git Concepts 1. Git Branching and Merging Branching allows you to create a separate line of development. It’s useful for working on different features or fixes…

    Read More
    guest
    0 Comments
    Oldest
    Newest Most Voted
    0
    Would love your thoughts, please comment.x
    ()
    x