Git Branches: Intuition and Reality

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • LearnThisRepo.com - Learn 300+ open source libraries for free using AI.
  • WorkOS - The modern API for authentication & user identity.
  • Git

    Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.

    > which branch on a remote is considered the default

    That part is actually covered by "the default branch in newly created repositories". There are two different places where its done:

    - This is the one you probably mean: [1]

    - This is an obscure feature: [2]. A Stack Overflow comment [3] calls it "one of the abandoned experiments that were being done before the concept of a remote was invented".

    Both of the places use function git_default_branch_name from refs.c [4], which uses config variable `init.defaultBranch` I've mentioned above.

    [1] https://github.com/git/git/blob/v2.43.0/remote.c#L2380-L2383

    [2] https://github.com/git/git/blob/v2.43.0/remote.c#L328-L338

    [3] https://stackoverflow.com/a/54132016/1083697

    [4] https://github.com/git/git/blob/v2.43.0/refs.c#L671-L705

  • build-extra

    Additional files and scripts to help build Git for Windows on MSYS2.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • example

    The branch_ref.name prints "refs/remotes/origin/test" but git status says "HEAD detached at origin/test"

    So I'm probably feeding the wrong thing into repo.checkout, but I'm honestly not sure what else it should be.

    Funnily enough, git itself tries to do the right thing if pulled in a detached head state:

        From https://github.com/testorg/example

  • gittuf

    A security layer for Git repositories

    It actually does but it's very much in alpha/active development (under the umbrella of OpenSSF with the intent of being integrated into mainline git eventually).

    https://github.com/gittuf/gittuf

  • GitExtensions

    Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).

    I agree that git is almost asking you to juggle commits.

    My preference is to use temporary branches and cherry-picking instead of stashing; I mostly use a gui* to work with git so it is easy to select the two or three commits to cherry-picking or see visually if an interactive rebase would work.

    * https://gitextensions.github.io/

  • LearnThisRepo.com

    Learn 300+ open source libraries for free using AI. LearnThisRepo lets you learn 300+ open source repos including Postgres, Langchain, VS Code, and more by chatting with them using AI!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts