You are here:Home»KB»Programming»My GitHub Notes
Sunday, 04 May 2025 06:56

My GitHub Notes

Written by

This will be a collection of GitHub specific and Git notes

TL;DR

I have put my real quick overview of accounts plans and who should use what here.

  • Public repositories
    • Host open source projects in public GitHub repositories, accessible via web or command line.
    • Public repositories are accessible to anyone at GitHub.com.
    • Collaborators and members for public repositories are always unlimited irrespective of your personal plan (e.g. free, Pro) or your organization's plan (e.g. Free, teams, Enterprise)
  • Private repositories
    • Host code in private GitHub repositories, accessible via appliance, web, and command line.
    • Private repositories are only accessible to you and people you share them with.
    • Collaborators and members for private repositories:
      • On a GitHub personal account (Free, Pro), collaborators and members are unlimited.
      • On a GitHub Free Organization, collaborators and members are unlimited.
      • Although collaborators and organization members serve different purposes within GitHub, for organizations subscribed to GitHub Team collaborators must occupy a paid seat in order to access private repositories. Organization members always require a paid seat.
      • If you decide to upgrade your organization from GitHub Free to GitHub Team, you must add a paid seat for each organization member as well as each collaborator for them to keep access.
        • No data will be lost, just access for those who do not have a seat.
        • You only need to buy seats for those users that you want to have access to the organizations repositories going forward, not for everybody who has every made a change or contribution to any of the organization's repositories.
      • Upgrading your account's plan - GitHub Docs - If you'd like additional users to have access to your GitHub Team organization's private repositories, you can purchase more seats anytime.
  • Pricing Plans
    • All pricing @ GitHub is done on a per-user basis.
    • Personal accounts and organization seats are classed as separate Billing entities.
    • If you upgrade your personal account from GitHub Free to the GitHub Pro plan then you can:
      • get additional features for your personal Private repositories such as Pages and Wikis
      • you will also get more Git features and various Code workflow enhancements for both your Public and Private repositories.
    • If you use GitHub Team for your organization you will also get enhancements for your Public and Private repositories as-well as improved organization management better granular user role control.
  • User Accounts
    • A user account is for one person and some times is referred to as a `Personal Account`.
    • A person only needs one user account. You only need one Facebook account right!
    • This account can be used to host all of a user's project and also be used to login in to organizations.
    • There are currently 2 pricing plans for an `personal` account, Free and Pro.
    • If you are an individual developers with no commercial angle, then you should just use a personal/single account for all of your repositories.
    • If you need more actions, features and that other stuff then you can upgrade your account to Pro.
    • I would use my personal account where I need to fork a repo to push some fixes to someone else's code.
    • A user can own more than one organization.
  • Organizations
    • Organizations are shared accounts where businesses and open-source projects can collaborate across many projects at once, with sophisticated security and administrative features.
    • GitHub Free allows you to add as many members and collaborators to your organization as you’d like at no charge.
    • There are currently 3 pricing plans for an account, Free, Team and Enterprise.
    • Having an organization for your company ensures that the assets are not controlled by single member of staff under their personal account.
    • You should use an organization for your code if:
      • If you are a company and you are making software.
      • If you are a individual developer or a company that is going to sell software.
      • You will need to collaborate with team members or other entities.
      • Your software project(s) will be large.
    • Features:
      • Allow for collaboration between team members and other entities.
      • Allows more granular permissions for repositories that belong to the organization.
      • An organisation can have public and private members. Public members do not count towards your organizations seats.
      • Allow for for organising repositories by groups such as; Company, Code Language, Software Type, etc.....
    • You can convert your personal account into an organization (but this is not best practice).
    • You can identify an organization easily because thy have a people tab.
    • Organizations can have more than one organization owner to avoid lapses in ownership.
  • Teams
    • The concept of Teams in GitHub allows for greater flexibility for collaboration and integration, as well as separation of repositories and permissions.
  • Enterprise accounts
    • Are for very large companies, or those teams that need to manage multiple organisations but all under the same company banner.
    • Pricing is done per member, each member requires a seat/license, I am assuming there will always be at leats one member.
  • Discounts

GitHub Official Sites

Misc Sites

GitHub Tutorials

  • Filtering and searching issues and pull requests - GitHub Docs - To find detailed information about a repository on GitHub, you can filter, sort, and search issues and pull requests that are relevant to the repository.
  • Searching issues and pull requests - GitHub Docs - You can search for issues and pull requests on GitHub and narrow the results using these search qualifiers in any combination.
  • How to maintain two repositories internal/private and one open-source · GitHub | igorcosta - Managing multiple repositories that serve distinct but interconnected purposes can be a challenging task. This scenario is common when an organization wishes to contribute to an open-source project while also maintaining an internal space for private collaboration.
  • Showing an overview of your activity on your profile - GitHub Docs - You can enable the activity overview section on your profile to give viewers more context about the types of contributions you make.
  • Viewing contributions on your profile - GitHub Docs - Your profile shows off your pinned repositories, Achievements, and a graph of your repository contributions over the past year.
  • View Forks
    Repository --> Insights --> Forks
    • Filters:
      • By default the list will only show forks with activity within the last 2 years, so make sure you set the filters accordingly.
      • There are many filters.
      • The filter Repository Type = Network (Forks of other forks) can be quite useful.
    • Switch to tree view: This is useful as it lets you see more repositories on the page at the same time. I think this is how it use to look on GitHub.
  • Compare different Branches / Versions
    https://github.com/Open-Shell/Open-Shell-Menu/compare/v4.4.190...v4.4.191

GitHub Structure

Account Plans / Pricing

  • Pricing
  • Upgrading / Downgrading Account Plan
    • Downgrading your account's plan - GitHub Docs
      • You can downgrade the plan for any type of account on GitHub at any time.
      • After an organization's plan is downgraded, the organization will lose access to any functionality that is not included in the new plan. If an advanced feature, such as GitHub Pages, is not available for private repositories in your new plan, consider whether you'd like to retain access to the feature by making affected repositories public.
      • Removing paid seats from your organization: To reduce the number of paid seats your organization uses, you can remove members from your organization or convert members to outside collaborators and give them access to only public repositories.
    • Upgrading your account's plan - GitHub Docs
      • You can upgrade the plan for any type of account on GitHub at any time.
      • About upgrades
        • Each account on GitHub is billed separately.
        • Upgrading an organization account enables paid features for the organization's repositories only and does not affect the features available in repositories owned by any associated personal accounts.
        • Similarly, upgrading a personal account enables paid features for the personal account's repositories only and does not affect the repositories of any organization accounts.
      • Upgrading your personal account's plan
        • You can upgrade your personal account from GitHub Free to GitHub Pro to get advanced code review tools on private repositories owned by your personal account.
        • Upgrading your personal account does not affect any organizations you may manage or repositories owned by those organizations.
      • Managing your organization's plan
        • You can upgrade your organization's plan, add seats to your existing plan, or switch from per-repository to per-user pricing.
        • Upgrading an organization does not affect your personal account or repositories owned by your personal account.
        • If your organization is using a legacy per-repository billing plan, you can switch to per-user pricing at any time. You will not be able to switch back to repository pricing once you've upgraded to per-user pricing.
        • If you'd like additional users to have access to your GitHub Team organization's private repositories, you can purchase more seats anytime.
  • Organizations
    • Github team users vs collaborators pricing. · community · Discussion #22012 · GitHub
      • GitHub Free allows you to add as many members and collaborators to your organization as you’d like at no charge.
      • If you decide to upgrade to GitHub Team, however, you must add a paid seat for each organization member as well as each collaborator. In your example, upgrading an 10-user organization from GitHub Free to GitHub Team would require 10 paid seats at $4 per month each, for a total charge of $40 per month.
      • Although collaborators and organization members serve different purposes within GitHub, for organizations subscribed to GitHub Team collaborators must occupy a paid seat in order to access private repositories. Organization members always require a paid seat.
      • If you have an existing subscription to GitHub Team with 10 users, then add another seat during the billing cycle, you’ll be charged a prorated amount of $4 to cover the period between when you added the seat and when the subscription typically renews.
    • About per-user pricing - GitHub Docs - Learn about per-user pricing for organizations.
      • People that consume a license:
        • Organization members, including owners
        • Outside collaborators on private repositories owned by your organization, excluding forks
        • Anyone with a pending invitation to become an outside collaborator on private or internal repositories owned by your organization, excluding forks
        • Dormant users
  • GitHub Pro
    • GitHub Pro feature comparison is hidden
      • You would expect these details to be available on the pricing page , but they are not. To find out the difference between GitHub Free and GitHub Pro follow the instructions below:
        • Login --> Profile --> Settings --> Billings and plans --> Plans and usage --> Upgrade
        • You can now see a side by side comparison on the 2 account plans.
      • Upgrading your account's plan - GitHub Docs
        • You can upgrade your personal account from GitHub Free to GitHub Pro to get advanced code review tools on private repositories owned by your personal account.
        • Upgrading your personal account does not affect any organizations you may manage or repositories owned by those organizations.
        • This has detailed instructions on upgrading to Pro
      • Pricing on the home page is for organizations.
      • Pro and a single Team user is $4 (which cannot be a coincidence)
    • Is Github Pro free for students? · community · Discussion #158175 · GitHub - Yes, eligible students can get GitHub Pro for free through the GitHub Student Developer Pack.
    • What happens to my repositories once the Pro membership expires? · community · Discussion #129354 · GitHub
      • When a GitHub Pro subscription expires, the account transitions back to the free tier.
      • This change primarily impacts features and limits but does not affect the availability or integrity of the repositories.
      • Public repositories remain public and fully accessible, ensuring continued visibility and collaboration.
      • Private repositories created during the Pro period retain their privacy, but the number of collaborators may be restricted to the limits of the free plan, typically capped at three.
      • Advanced features exclusive to GitHub Pro, such as enhanced code review tools, repository insights, and additional CI/CD minutes and storage, become unavailable.
      • Users may experience limitations if their usage exceeds the free plan’s data transfer and storage limits, potentially leading to restricted repository actions until usage is reduced or additional resources are purchased.
      • Pro-specific support and advanced security features, like code scanning and secret scanning, are also discontinued.
      • Despite these changes, all existing repositories remain intact and functional, ensuring no loss of data or accessibility.
    • GitHub pro · community · Discussion #67993 · GitHub - Can someone please explain how the GitHub pro version works. I thought it works like having a Team organization account?
      • GitHub Pro is a subscription plan for individual users on GitHub and is distinct from GitHub Team, which is designed for organizations. Here's how GitHub Pro works:
        • Individual Subscription: GitHub Pro is meant for individual developers who want enhanced features and capabilities beyond what's available in the free GitHub plan. It's not associated with an organization or team account.
        • Enhanced Features: GitHub Pro provides several benefits over the free GitHub account.
        • In summary, GitHub Pro is a paid subscription plan for individual developers who want enhanced features and unlimited private repositories. It is not the same as a GitHub Team organization account, which is designed for collaborative work within teams or organizations and includes more extensive management and collaboration features.

GitHub Account Types

Organizations

  • Overview
    • About organizations - GitHub Docs
      • Organizations are shared accounts where businesses and open-source projects can collaborate across many projects at once, with sophisticated security and administrative features.
      • Your team can collaborate on GitHub by using an organization account, which serves as a container for your shared work and gives the work a unique name and brand.
      • Each person that uses GitHub always signs into a personal account, and multiple personal accounts can collaborate on shared projects by joining the same organization account.
      • You can use organizations for free, with GitHub Free, which includes limited features on private repositories. To get the full feature set on private repositories and additional features at the organization level, including SAML single sign-on and improved support coverage, you can upgrade to GitHub Team or GitHub Enterprise Cloud. For more information, see GitHub’s plans.
      • Enterprise accounts are a feature of GitHub Enterprise Cloud that allow owners to centrally manage policy and billing for multiple organizations.
    • github organization plans | Bing Search
      • GitHub organization plans are options for teams and businesses to use GitHub features and services. Organizations can use GitHub for free, with limited features on private repositories, or upgrade to GitHub Team or GitHub Enterprise Cloud for more features and support. GitHub Free for organizations includes private repositories for unlimited users, and GitHub Free for individual developers includes unlimited collaborators. To create an organization, you need to follow the prompts on the GitHub website.
    • What Are GitHub Organizations, and Should You Use One? | How-To Geek
      • GitHub Organizations is a feature of GitHub that allows you to create a central place where team members can access and manage repositories and other resources.
      • Grouping them all under one name on a non-personal account is a great organizational tool. Repositories made under organizations will use the organization name instead of your personal account as the prefix, which can look more professional.
      • Beyond that, Organizations also provide many features for teams, such as centralized user and permission management.
    • Maintaining ownership continuity for your organization - GitHub Docs - Organizations can have more than one organization owner to avoid lapses in ownership.
    • Limit on Write Collaborators | Github Organization (Free) · community · Discussion #140992 · GitHub
      • Q:
        • I want to create a Free Github Organization account, where I would have several private repositories.
        • Are there any limits on the number of (free) members that can join the private repositories with write permissions? (I am mostly concerned about organization members; not external collaborators).
        • I am being told that there is , but I can't seem to find anything in Github's documentation that says so...
      • A:
        • Great question! For a free GitHub Organization account, you can have unlimited private repositories, and there's no limit on the number of members within the organization. However, the distinction comes with permissions—free organization accounts can add as many members as they want, but those members all receive the same default permissions.
        • If you're adding members to your organization, they will all get read or write permissions for private repositories depending on how you set up access. GitHub doesn’t explicitly limit the number of these organization members, but you might run into practical management issues if the group gets too large without paid features for more granular control.
  • Setup / Configure
    • nothing here yet
  • Creating a new Organization
  • Converting an Account to an Organization
  • Transfer a repository to an Organization
  • Personal Account or Organization
  • Roles
    • About organization membership - GitHub Docs - You can become a member of an organization to collaborate with coworkers or open-source contributors across many repositories at once.
    • Roles in an organization - GitHub Docs
      • Organization owners can assign roles to individuals and teams giving them different sets of permissions in the organization.
      • Outside collaborator, To keep your organization's data secure while allowing access to repositories, you can add outside collaborators. An outside collaborator is a person who has access to one or more organization repositories but is not explicitly a member of the organization, such as a consultant or temporary employee.
    • Repository roles for an organization - GitHub Docs - You can customize access to each repository in your organization by assigning granular roles, giving people access to the features and tasks they need.
    • Converting an organization member to an outside collaborator - GitHub Docs - If a current member of your organization only needs access to certain repositories, such as consultants or temporary employees, you can convert them to an outside collaborator.
  • Benefits of an Organization
    • Can put all of a companies repos in one place
    • Can be a separate assets that can be attached to the company rather than a personal account.
    • It is not a personal account. a personal account should belong to a single person and not a company.
    • Permissions can be more fine grained
    • Organizations can be part of an enterprise account
  • How can I tell if a repository belongs to an organization?
  • Contributors / Collaborators / Members
    • What is the difference between contributor, member and collaborator? - Open Source Stack Exchange
      • Contributors - When a user's set of email addresses is found in the commit history of a github repo, github marks that user as a contributor.
      • Collaborators - A user that has defined permissions in a github repo is marked as a collaborator. These permissions can vary and do not need to be the commit bit.
      • Members - When a github repo belongs to an organization, users that have membership in that organization are marked "Member" in the same space used for "Contributor" and "Collaborator". 
    • Adding outside collaborators to repositories in your organization - GitHub Docs
      • You can allow people who aren't members of your organization to access repositories that your organization owns.
      • An outside collaborator is a person who is not a member of your organization, but has access to one or more of your organization's repositories.
      • You can choose the level of access to grant for each outside collaborator.
      • Unless you are on a free plan, adding an outside collaborator to a private repository will use one of your paid licenses. For more information, see "About per-user pricing."

Public vs Private

How to structure your Github Organization, Repositories and Users

This section will deal with configuring GitHub for your developing and company needs.

  • The hierarchy of GitHub is as follows:
    • Enterprise Account --> Organization --> Repository --> Users
  • Orgs and Teams Best Practices · GitHub | joshjohanning - Orgs and Teams Best Practices. GitHub Gist: instantly share code, notes, and snippets.
    • The intention of this document is to provide some guidance and suggestions to customers who are wondering how they should structure organizations and teams in their GitHub Enterprise environment. The idea isn't to give hard and fast rules on which approach is better than the other, but to give examples of when one approach might be preferable to another depending on the use case.
    • The concept of Teams in GitHub allows for greater flexibility for collaboration and integration, as well as separation of repositories and permissions.
    • Excellent article
  • How should you structure your GitHub Organizations? - YouTube
    • There are a lot of different ways to structure your GitHub Organizations. One organization to rule them all, multiple organizations, even LOTS of organizations. There are some pros and cons you need to consider with any method that you choose.
    • Very chilled out video
    • Enterprise account --> Organizations --> Repositories
    • How many Organizations do we need?
    • Strategies for using organizations in GitHub Enterprise Cloud - GitHub Resources
      • Within GitHub Enterprise Cloud (GHEC), organizations are shared accounts where your users collaborate across many projects at once, with sophisticated security and administrative features. It’s important to plan your structure in advance to avoid creating unnecessary silos and increase administrative overhead. A good structure will facilitate collaboration and discovery while reducing administrative overhead.
      • In general, we recommend creating the fewest possible organizations within your enterprise to accommodate your business needs.
      • Model 1: Single Organization
        • In this model, a single organization is used for all or the vast majority of repositories. Many small- to medium-sized organizations (less than 5,000 developers) use this approach to manage their GitHub environment.
      • Model 2: Red-green-sandbox-archive
      • Model 3: Portfolio company
  • GitHub Organization Best Practices - A concise guide on best practices for managing single vs multiple GitHub Enterprise Organizations
    • Note: Distinct organizations are NOT needed to limit repository access. Repository access can be limited via base user permissions and Teams.
    • Individual organizations are intended for users who work together, i.e., whole engineering teams and their cross-functional counterparts.
    • When does it make sense to create more than one organization?
  • Expert guide: Transfer Github to Organization step-by-step - YouTube | TechTimeFly
    • This guy uses repositories to separate his code by language.
    • The video is just for context

GitHub Account Management

Does setting up a SSH key and PAT allow me to use them to recover my account with my email address when locked out of my account???

Account Setup

  • Password
    • Use a strong password
    • Store the password in a secure password manager.
  • Recovery codes
    • Download them
    • print them out
    • install them into a secure password manager
  • Enable 2FA
    • with as many methods as possible except maybe SMS as this not classed as secure
  • Use passeys?
  • Create an SSH key
    • Can this be used for account recovery
  • Create a Personal Access Token
    • Can this be used for account recovery
  • Setup your profile
    • Fill in your information and make sure only what you want is shown publicaly.

Account Recovery

Read this article, it is very clear and calming.

  • How to Recover Your GitHub Account
    • Regain access to your GitHub account with a step-by-step guide on using 2FA codes, email verification, and support requests for account recovery.
    • Best Practices to Prevent Account Lockout
      1. Setting Up Multiple 2FA Methods for Backup
      2. Downloading and Securely Storing Recovery Codes
      3. Ensuring Access to Verified Devices and Email Addresses
  • Recovery options are as follows (not all might be available to you):
    1. Recovery codes.
    2. Previously verified device
    3. SSH key
    4. Personal access token
    5. Additional Emails for recovery
      • This is only useful if you do not have 2FA enabled on your account.
      • Profile --> Settings --> Emails --> Add email address
      • https://github.com/settings/emails --> Add email address
  • Recovering your account if you lose your 2FA credentials - GitHub Docs
    • If you lose access to your two-factor authentication credentials, you can use your recovery codes, or another recovery option, to regain access to your account.
    • For security reasons, GitHub Support will not be able to restore access to accounts with two-factor authentication enabled if you lose your two-factor authentication credentials or lose access to your account recovery methods.
    • If you cannot use any recovery methods, you have permanently lost access to your account. However, you can unlink an email address tied to the locked account. The unlinked email address can then be linked to a new or existing account. For more information, see Unlinking your email address from a locked account.
  • Recovering your account if you lose your 2FA credentials - GitHub Docs
    • If you lose access to your two-factor authentication credentials, you can use your recovery codes, or another recovery option, to regain access to your account.
    • Follow Instructions here and will need at least one of the following alternative authentication factors:
      • Previously verified device
      • SSH key
      • Personal access token
    • A member of GitHub Support will review your request and email you within three business days. If your request is approved, you'll receive a link to complete your account recovery process. If your request is denied, the email will include a way to contact support with any additional questions.
  • GitHub Account Recovery Policy - GitHub Docs
    • Get started, troubleshoot, and make the most of GitHub. Documentation for new users, developers, administrators, and all of GitHub's products.
    • GitHub provides a number of account recovery methods including an automated recovery process if you have lost access to your GitHub.com account. If you cannot use any of the provided recovery methods, you have permanently lost access to your account.
    • For security reasons, GitHub Support will not restore access to accounts with two-factor authentication enabled if you lose your two-factor authentication credentials or lose access to your account recovery methods. You must use existing account recovery methods.
    • GitHub does not support any other means of account recovery, including social or ID verification, by members of GitHub’s staff. This policy is in place to protect your account from unauthorized access through social engineering.
  • How to Recover Your GitHub Account - Regain access to your GitHub account with a step-by-step guide on using 2FA codes, email verification, and support requests for account recovery.
  • GitHub Account Recovery Policy - GitHub Docs - Get started, troubleshoot, and make the most of GitHub. Documentation for new users, developers, administrators, and all of GitHub's products.
  • New 2FA account recovery options via password reset flow - GitHub Changelog
    • Users with two-factor authentication enabled can now begin the account recovery process from the password reset flow.
    • With this change, a user can recover their account as long as they can perform email verification and provide a recovery factor, such as an SSH key, PAT (Personal Access Token), or previously signed in device.
  • Unlinking your email address from a locked account - GitHub Docs - If you have lost your two-factor authentication (2FA) credentials and are unable to recover access, you can remove the connection between your email address and a 2FA locked account. The email address is then available for you to link it to a new or existing account, maintaining your commit history.

Authentication

  • General
  • Passkeys
    • Passkeys are a password replacement that validates your identity using touch, facial recognition, a device password, or a PIN.
    • Passkeys can be used for sign-in as a simple and secure alternative to your password and two-factor credentials.
    • About passkeys - GitHub Docs
      • Passkeys allow you to sign in safely and easily, without requiring a password and two-factor authentication.
      • Passkeys are webauthn credentials that validate your identity using touch, facial recognition, a device password, or a PIN. They can be used as a password replacement or as a 2FA method. Passkeys can be used for sign-in as a simple and secure alternative to your password and two-factor credentials.
    • Managing your passkeys - GitHub Docs - You may be prompted to register a passkey during sign-in, or you can choose to register a new passkey in your account settings. For 2FA users, you can upgrade existing eligible security keys into passkeys.
  • Personal Access Token (PAT)
    • Personal access tokens were initially introduced to replace passwords for authentication to GitHub's API and command-line interface. Over time, their functionality has expanded, including their use in account recovery scenarios.
    • Managing your personal access tokens - GitHub Docs - You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.

2FA

This is covering the use of 2FA on GitHub.

  • If you loose your 2FA methods and your Recovery codes then you will be locked out of your account permanently, this is to protect GitHub and users from social engineering.
  • You can use any 2FA method you have configured to login which is useful if you loose access to one.
  • Make sure you set up as many recovery methods as possible.
    • Having multiple 2FA methods reduces the risk of users getting locked out of their accounts
  • 2FA does not just mean TOTP, you can also add SMS, Github Mobile.
    • SMS is not really secure, but easy to setup and can prevent lockout.
  • Download and print out your Recovery codes
    • When you change your password your Recovery Codes will be revoked and new ones issued which you should download immediately.
    • Download 2FA Recovery codes here:
      Profile --> Settings --> Access --> Password and authentication --> Recovery options --> Recovery codes --> View
  • General
    • 2FA methods available
      • Authenticator app
        • Uses TOTP
        • Use 2FAS as your OTP manager.
      • SMS/Text message
        • This is a code sent your mobile phone.
        • It is better than nothing.
      • Security keys
      • GitHub Mobile
        • Install the GitHub app and use this as an authenticator.
        • Easy to use and I recommend using this.
  • Official Docs
    • Securing your account with two-factor authentication (2FA) - GitHub Docs - You can set up your account on GitHub to require an authentication code in addition to your password when you sign in.
    • Configuring two-factor authentication recovery methods - GitHub Docs
      • You can set up a variety of recovery methods to access your account if you lose your two-factor authentication credentials.
      • Print your codes on paper and store securely in a password manager.
      • If you enable/disable 2FA then your current codes will become invalid.
    • Configuring two-factor authentication - GitHub Docs
      • You can choose among multiple options to add a second source of authentication to your account.
      • We strongly recommend using a time-based one-time password (TOTP) application to configure 2FA, and security keys as backup methods instead of SMS. TOTP applications are more reliable than SMS, especially for locations outside the United States. Many TOTP apps support the secure backup of your authentication codes in the cloud and can be restored if you lose access to your device.
      • After you configure 2FA, your account will enter a 28-day check up period. You can leave the check up period by successfully performing 2FA in those 28 days. Otherwise, you will be prompted to perform 2FA in an existing GitHub.com session on the 28th day. If you cannot perform 2FA to pass the checkup, you must use the provided shortcut to reconfigure your 2FA settings and retain access to GitHub.com.
    • Git Good at Securing your Code - How to enable 2FA on GitHub - YouTube | GitHub
      • If you don't already have two-factor authentication setup, check out how to enable this feature now.
      • This is an easy to follow video
    • What was discovered when we enforced 2FA for millions of users - YouTube | GitHub
      • GitHub product designer Hemant Kumar discusses implementing two-factor authentication (2FA) at scale, driven by empathy for our users and a commitment to software security.
      • The project showcases cross-functional collaboration, user-centered design, and strategic communication, resulting in improved user experience while reducing support requests and account lockouts.
      • This explains the process and what this means to a user.
  • What I did
    • Added 2x recovery emails
    • Added a mobile phone for SMS recovery
    • Added GitHub Mobile as a 2FA (installed and logged in on my phone)
    • * (not done yet) Added TOTP using 2FAS (Android)
    • Saved my recovery codes to my password manager (Bitwarden)
    • Printed my recovery codes on paper

GitHub Services

GitHub Search

The search feature on GitHub is very powerful and is underused by a lot of people.

GitHub Pages

This free feature allows you to run websites directly from GitHub, even with your own custom domain name. Useful for small developers who are bandwidth constrained.

Gists

What are they and how to do you create, edit and share them.

Apps

in the marketplace, how do i use them + put examples here.

GitHub Repositories

General

  • About repositories - GitHub Docs
    • A repository contains all of your code, your files, and each file's revision history. You can discuss and manage your work within the repository.
    • When you create a repository, you can choose to make the repository public or private. Repositories in organizations that use GitHub Enterprise Cloud and are owned by an enterprise account can also be created with internal visibility.
    • Public repositories are accessible to everyone on the internet.
    • Private repositories are only accessible to you, people you explicitly share access with, and, for organization repositories, certain organization members.
  • Branch Default Name
    • Why GitHub renamed its master branch to main | TheServerSide - GitHub renamed the master branch to main for any Git repository, as it addresses cultural change like so many organizations that have nixed master-slave terminology in a time of social unrest.
    • You can set the default branch name in your profile
      Settings --> Code, planning and automation --> Repositories --> Repository default branch: master/main

Setup

Once your organizational structure (or not) is configured you then actually need to create your repos. In this section we will deal with how to setup a nice looking repository to ge the best out of it.

  • GitHub - KatherineMichel/setting-up-an-open-source-project - Setting Up An Open Source Project.
    • Organization accounts are for code owned by groups (companies, OSS projects).
    • Teams make permission management easier. A developer added to a team now has access to repos based on team access.
    • Repository Access
      • Public repo - anyone can access
      • Private repo - only designated members can access
  • Setting up your project for healthy contributions - GitHub Docs - Repository maintainers can set contributing guidelines to help collaborators make meaningful, useful contributions to a project.
  • Always add tags ?
    joomla
    joomla-component
    joomla-extensions
    app-server
    app-site 

GitHub Errors, Issues and their solutions

  • Permalinks are not rendered into code blocks
    • Issue
      • When i am copying permalinks and then pasting them into a GitHub editor they are not getting parsed into code blocks.
    • Cause
      • If you look at the end of the faulty links you can see there is a alphanumeric code after the line definition eg: C1,C6 in the example below.
        Bad: https://github.com/webmin/authentic-theme/blob/0ca0f9e215fdad49e028158f1f0d5096295a8595/tconfig-lib.pl#L201C1-L204C6
      • If I remove C1 and C6 respectively at the end of the permalink, the permalink is rendered into a code block.
        Good: https://github.com/webmin/authentic-theme/blob/0ca0f9e215fdad49e028158f1f0d5096295a8595/tconfig-lib.pl#L201-L204
      • When you select by the code, the characters where you started and finished your selection from are added on the end in the form of C1,C2 and it is this new format blocking the rendering of this into a code block.
    • Solution
      • Select directly on the line numbers rather than selecting the code.
    • Links
    • Notes
      • This should work cross repository but some people say it does not. I have not verified this either way.
  • "git-receive-pack not permitted"
    • Might be because the git repootpry is archived.
    • git-receive-pack not permitted - Bing Search
      • The "git-receive-pack not permitted" error typically indicates a permissions issue when trying to push changes to a remote Git repository.
  • ^M characters being shown in a GitHub Diff
    • Issue
      • As you can see there are these red ^M control characters and the text file does not have correct formatting because the line endings are not working as they should.
    • Cause
      • The line endings are not being handled correctly between Windows and GitHub
    • Solutions
      1. Set your editor to work with LF(Unix/Linux) locally
      2. Set Git to automatically alter line from CRLF(Windows) to LF(Linux/Unix) endings before submission and vice-versa upon checkout.
    • Links
      • What is the meaning of ^M in 'git diff'? - Stack Overflow
        • ^M represents carriage return (CR). This diff means something removed a Unicode BOM from the beginning of the line and added a CR at the end.
        • If ^M is in the new-changes side (right/green side), then that means the file's line-endings were changed from LF to CRLF, otherwise, file was CRLF and is now changed to LF.
        • The ^ symbol stands for Control, so ^M means Ctrl+M.
        • To get from that to the actual ASCII character code, you take the base character and flip bit 6 (i.e. XOR with 64). For letters, that just means subtract 64. So e.g. ^A is character code 1 (because A is 65). ^M is 77 - 64 = 13 (because M is 77), which corresponds to carriage return in ASCII.
        • ^L represents the form-feed character (FF is the abbreviation, not hexadecimal), and has ASCII value 12 or 0x0C.
        • Try
          • git config core.whitespace cr-at-eol to hide it from the diff
          • git config --global core.autocrlf true
      • Difference Between Carriage Return (CR) and Line Feed (LF) ? How it is used in Different Operating System? | GeeksforGeeks - This article will explain their History, Usage in Different Operating Systems, Related Issues, what they are, when they were introduced, and how one can use them to address various issues arising from the e of CR, and LF.
      • Why does Windows use CR LF? - Stack Overflow
        • Historically when using teletypes CR would return the carriage to the first position of the line while LF would feed to the next line.
        • Using CR+LF in the file themselves made it possible to send a file directly to the printer, without any kind of printer driver.
      • Why is the line terminator CR+LF? - The Old New Thing - This shows the practical difference between the CR and LF when they were first used.

Repository Content

This content is not all specific to GitHub but deserves to be separate section.

Donation Services

  • GitHub Sponsors · GitHub - Invest in the open source projects you depend on with GitHub Sponsors.
  • Patreon
    • Patreon is the best place to build community with your biggest fans, share exclusive work, and turn your passion into a lasting creative business.
    • This has button inside my personal GitHub account to link to a Patreon account.
  • Ko-fi | Make money doing what you love - Join 1,000,000+ creators! Set up your free page to get tips, sell products, offer memberships, and grow your community.
  • Open Collective
    • Raise, manage and disburse money with full transparency.
    • We make it easy to raise, manage, and disburse money with full transparency. Start your open collective, apply to a Fiscal Host, and unlock funding for your community—free from red tape. The future is collective.
    • Open Collective is a legal and financial toolbox for groups. It’s a fundraising + legal status + money management platform for your community. What do you want to do?
  • Buy Me a Coffee - Buy Me a Coffee is the best way for creators and artists to accept support and membership from their fans.

README.md - Extras

Things like flags and badges, add the code and tutorials for them here.

Markdown Examples, Snippets and Templates

Repository Layouts

File and Templates

Git

General

I will include how to use Git in VSCode tips and tricks.

  • Commands
    • Git Cheat Sheet | GeeksforGeeks
      • Git Cheat Sheet is a comprehensive quick guide for learning Git concepts, from very basic to advanced levels. By this Git Cheat Sheet, our aim is to provide a handy reference tool for both beginners and experienced developers/DevOps engineers.
      • This Git Cheat Sheet not only makes it easier for newcomers to get started but also serves as a refresher for experienced professionals.
    • Git commands: A comprehensive cheat sheet (with examples) - Sling Academy - This comprehensive cheat sheet will take you through the basic to advanced Git commands with examples and expected outputs, helping you navigate and use Git more effectively.
    • Patch software on Linux, using GitHub (from virtualmin)
      • With inux you can get coed straight from GitHub and apply it to your Linux files as shown in this example below:
        ## CentOS / Alma / Rocky / RHEL
        cd /usr/libexec/webmin/virtual-server
        
        ## Ubuntu
        cd /usr/share/webmin/virtual-server
        
        ## Common (the actual patch command)
        curl https://github.com/virtualmin/virtualmin-gpl/commit/7037f778b30eda80bb9a8a3a1bd4065377763b1c.patch | git apply --reject --whitespace=fix
        curl https://github.com/virtualmin/virtualmin-gpl/commit/85f803eb05e1fe8db0b59bd5a44fec8590034e88.patch | git apply --reject --whitespace=fix
        This is from https://github.com/virtualmin/virtualmin-gpl/issues/747
  • Working Tree
  • History
  • Commiting
  • Git Configuration (.gitconfig)

What Git stores

  • Git tracks:
    • Source code and project files
    • Commits
    • Branches
    • Tags
    • References
    • Git objects (blobs, trees, etc.)
  • Git does not track:
    • Issues
    • Pull Requests
    • Wikis
    • Project boards
    • Discussions

Issues

  • Issues in GitHub - GeeksforGeeks
    • GitHub is more than just a platform for hosting code; it’s a powerful tool for managing projects and collaborating with teams. One of the key features that provides this is the Issues system. GitHub Issues helps developers track bugs, enhancements, and tasks, ensuring that projects stay organized and on track. In this article, we'll see what GitHub Issues are, how to use them effectively, and best practices for managing them.
    • Issues are Bolt Ons and are not transferred with forks.

Working with Forks

  • Fork a repository - GitHub Docs - A fork is a new repository that shares code and visibility settings with the original “upstream” repository.
  • You can now fork a repo and copy only the default branch - GitHub Changelog
    • Previously, when creating a fork all branches from the parent repository were copied to the new fork repository. There are several scenarios where this is unneeded, such as contributing to open-source projects. When all branches are copied, it could result in slow repo cloning and unnecessary disk usage. With this new feature, only the default branch is copied; no other branches or tags. This may result in faster clones because only reachable objects will be pulled down.
  • Forking a repository versus duplicating a repository - About forks - GitHub Docs - If you want to create a new repository from the contents of an existing repository but don't want to merge your changes to the upstream in the future, you can duplicate the repository or, if the repository is a template, you can use the repository as a template.
  • When forking a repository on GitHub, you have the option to select "Copy the default branch only."
    • If you leave this option unchecked, GitHub will copy all branches from the source repository into your fork.
    • This means your fork will include every branch present in the original repository, not just the default branch (commonly named main or master). This can be beneficial if you need access to multiple branches for development or reference purposes.
    • For more details, you can refer to GitHub's official documentation on forking repositories here.
  • When I fork a repository are the issues copied as well?
    • No, when you fork a repository on GitHub, the issues from the original repository are not copied to your fork.
    • Forking creates a new repository that includes the code, commit history, branches, and tags, but it does not include issues, pull requests, or other metadata.
    • This design ensures that discussions and issue tracking remain centralized in the original repository, preventing fragmentation across multiple forks.
    • If you need to reference or track issues in your forked repository, GitHub provides the ability to transfer individual issues between repositories. This process must be done manually for each issue. For detailed steps, see Transferring an issue to another repository.
    • Alternatively, if you're looking to duplicate a repository along with its issues, you might consider using third-party tools or scripts that utilize GitHub's API to export and import issues. However, these methods require additional setup and permissions.
    • Issues are not part of Git — they are a feature provided by GitHub (and other Git hosting platforms like GitLab or Bitbucket).
    • Issues are not stored in the Git repository itself. They live on the GitHub platform, as part of its web-based features for project management, collaboration, and discussion.

Git GUIs and Apps

These are just here for reference, you should only use VSCode with the relevant extensions. It should be noted most IDE also have visual GUIs for handling Git.

Repository Files and Folders

There are all of these files and folders that everyone seems to use so I am going to try and get a full list.

  • .github/
    • GitHub settings folder which holds things like issue templates.
  • .vscode/
    • VSCode workspace settings folder
    • Workspace settings are specific to a project and can be shared with other developers on your team.
  • .vscode/extensions.json
    • Recommended extension settings that should be followed by the entire team.
  • .vscode/launch.json
    • Debug configurations, usually shared between a team.
  • .vscode/tasks.json
  • .vscode/settings.json
    • Used to enforce project-specific settings and overrides global user settings, e.g. specific formatting rules.
  • .phan/...
  • .editorconfig
  • .env
  • .gitattributes
  • .gitignore
  • .git-blame-ignore-revs
  • .gitmodules
  • .prettierrc
    • prettier config file
  • .prettierignore
    • file to say which files/folders should be ignored by prettier
  • .php_cs.cache
  • .vscodeignore
  • .travis.yml
  • .php-cs-fixer.dist.php
  • .drone.yml
  • .appveyor.yml
  • .eslintrc
    • ESLint config file.
    • As off ESLint v9.0.0 it is deprecated.
  • .eslintrc.js
    • ESLint config file.
    • As off ESLint v9.0.0 it is deprecated.
  • .eslintrc.json
    • ESLint config file
    • As off ESLint v9.0.0 it is deprecated.
  • .eslintignore
    • Files to be ignored by the ESLint processor
  • eslint.config.js
    • ESlint V9.0.0+ config file
  • .tsconfig.json
  • webpack.config.js
  • yarn.lock
  • package.json
  • package.yaml
  • package-json-schema.json
  • package-lock.json
  • package.nls.json
  • checkstyle.json
  • composer.json
  • composer.lock
  • web.configruleset.xml
  • renovate.json
  • phpunit.xml.dist
  • phpunit-pgsql.xml.dist
  • phpstan.neon
  • cypress.config.dist.mjs
  • build.xml
  • CODE_OF_CONDUCT.md
  • LICENSE
  • LICENSE-CODE
  • README.md
  • SECURITY.md
  • SUPPORT.md

 

Read 252 times Last modified on Sunday, 08 June 2025 10:15