• Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    23
    ·
    8 hours ago

    it has always bothered me that checkout is overloaded: it can switch branches or discard pending changes in an unrecoverable way.

    so, PSA, you can replicate the safe part of checkout with git switch and the unsafe with git restore.

  • rhabarba@feddit.org
    link
    fedilink
    arrow-up
    26
    arrow-down
    8
    ·
    8 hours ago

    I renamed my master branch slaveowner. To make it more clear.

    It is software, my friends. It’s not a tribe of people.

    • chuckleslord@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      3
      ·
      3 hours ago

      Not gonna lie, the master branch thing is problematic but I don’t typically see an issue with it. It’s similar to master bedroom or bath. Kind of fucked up name origin, but I don’t think anyone’s really making a fuss about it.

      Whatever the fuck you’re doing though feels like some gross, racist fantasy. It’s really weird, dude. If you think that’s funny you might need to go talk to some real people or touch grass.

    • cenzorrll@piefed.ca
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      2
      ·
      6 hours ago

      You could do that, but I could argue that master/slave nomenclature isnt a good scheme for this anyway, since it doesn’t control any other branches. Unlike master and slave drives from the olden days.

      By all means go ahead and keep your naming schemes. It’s your own stuff that after all, that for some reason you felt the need to tell everyone about. However, I might recommend trying to move past it seeing as language has an impact on how people think, and being edgy doesn’t exactly have a good track record of producing the best people.

      • psycotica0@lemmy.ca
        link
        fedilink
        arrow-up
        10
        ·
        3 hours ago

        I always assumed the name was more of a reference to audio Master Recordings.

        It’s the original tapes or whatever that all copies are derived from. It’s also where the term “remastering” comes from, as in “we went in and rebuilt a new master from the individual tracks, and this is the new master now”, versus just making another copy of the master for a re-release.

      • rhabarba@feddit.org
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        6 hours ago

        My “master” branch actually does control other branches, as releases are usually made from it, so they all depend on it.

  • Zagorath@aussie.zone
    link
    fedilink
    English
    arrow-up
    7
    ·
    9 hours ago
    Transcription

    The “It’s an Older Meme, But It Checks Out” meme, featuring an image of an Imperial officer from Star Wars, with the caption:

    It’s an older branch, sir

    But it checks out

  • Zagorath@aussie.zone
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    9 hours ago

    I usually create new repos through GitHub or another central repo’s system, where it defaults to calling the main branch main. But I did recently create a new repo with my local Git’s git init, and had to deal with a master branch on a completely new repo for the first time in a while. It was actually kinda a weird experience.

    • NuXCOM_90Percent@lemmy.zip
      link
      fedilink
      arrow-up
      18
      ·
      edit-2
      9 hours ago
      git checkout -b main
      git branch -D master
      git config --global init.defaultBranch main
      

      You don’t have to deal with shit if you don’t want to.

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      9 hours ago

      If you haven’t already found it, you need to change your global git config (~/.gitconfig):

      git config --global init.defaultBranch main

      (or whatever you want to call it; e.g. daddy would work too)

      For any existing repositories you want to run the following command in the existing repository root (./.git/config):

      git config set init.defaultBranch main