Brdsnest Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemdro.id to Programmer Humor@programming.devEnglish · 1 day ago

When you screw up git

lemmy.zip

message-square
62
fedilink
719

When you screw up git

lemmy.zip

cm0002@lemdro.id to Programmer Humor@programming.devEnglish · 1 day ago
message-square
62
fedilink
alert-triangle
You must log in or register to comment.
  • aliser@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    9 hours ago

    git is like a minefield. stray away even a little bit from standard path and you are done for. I had git multiple times throw some obscure errors at me when trying some commands and then trying to undo/recover. how’s “undo” is not a git command I don’t understand.

    • nialv7@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      5 hours ago

      undo is a jj command ;)

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    10 hours ago

    in life you commit to many things. you commit to yourself, to your partner, to happiness, to legacy.

    when we die, is that like a push to origin?

    when we die, do our commits all go to the big repo in the sky?

    is god the maintainer? when you pray is that like a bug report?

    so many questions…

  • magic_lobster_party@fedia.io
    link
    fedilink
    arrow-up
    8
    ·
    14 hours ago

    Keep your commits small. Merge often. That will reduce the likelihood of terrible merge conflicts.

    If you’re not sharing your work with your team mates for a long time, then you’re setting yourself up for trouble.

    • SpaceCowboy@lemmy.ca
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      14 hours ago

      Also rebase is usually better than merge.

  • schnurrito@discuss.tchncs.de
    link
    fedilink
    arrow-up
    6
    ·
    14 hours ago

    I remember when similar screenshots circulated for how to tell if i am running jdk or jre, which is even more surprising.

  • SkunkWorkz@lemmy.world
    link
    fedilink
    arrow-up
    29
    ·
    20 hours ago

    “Proper way to commit after merge conflict” sounds like a robot trying to save a relationship after a bad sex experience

  • Cevilia (she/they/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    95
    ·
    1 day ago

    Holy fuck, that’s a long phone number

    • √𝛂𝛋𝛆@piefed.world
      link
      fedilink
      English
      arrow-up
      61
      arrow-down
      1
      ·
      23 hours ago

      It is a duplicated repeating error because this clownshow of a website is managed by squirrels and ducks. 1-800-273-8255 would be a valid US number. Doubling 273-8255 is not, but probably vibe coded under management that should be purged by these results.

      • GreenShimada@lemmy.world
        link
        fedilink
        arrow-up
        24
        ·
        23 hours ago

        Hey! Don’t insult ducks like that! This clownshow website would be about 20% better if ducks were involved.

        • √𝛂𝛋𝛆@piefed.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          23 hours ago

          I don’t know. I was cursing at ducks an hour ago while trying to remember how to spell diatomaceous earth and the ducks were total fuckwits.

      • Whostosay@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        22 hours ago

        Why not 1800-SUICIDE?

        • Eager Eagle@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          13 hours ago

          It exists too, it seems to be a support line from British Columbia, CA

          https://www.crisislines.bc.ca/services

        • √𝛂𝛋𝛆@piefed.world
          link
          fedilink
          English
          arrow-up
          12
          ·
          22 hours ago

          intentions unclear. Am I calling For or Against

          • Whostosay@sh.itjust.works
            link
            fedilink
            arrow-up
            9
            ·
            22 hours ago

            Your call.

            Buh dun tissss

        • locuester@lemmy.zip
          link
          fedilink
          English
          arrow-up
          5
          ·
          22 hours ago

          It’s 1-800-APE-TALK

          • Whostosay@sh.itjust.works
            link
            fedilink
            arrow-up
            5
            ·
            22 hours ago

            Lmao not willing to do the phone math rn, does that actually fit the numbers?

            • locuester@lemmy.zip
              link
              fedilink
              English
              arrow-up
              2
              ·
              22 hours ago

              Yes.

              • Whostosay@sh.itjust.works
                link
                fedilink
                arrow-up
                2
                ·
                22 hours ago

                That could be platformed.

                WAIT YOU HAVE SO MUCH TO LIVE FOR, have you tried ape talk?

                Well, I can’t say that I have.

    • Catoblepas@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      41
      arrow-down
      1
      ·
      24 hours ago

      Well, that’s easy to remember! 0118, 999, 881, 999, 119, 725…3.

      • fedditter@feddit.org
        link
        fedilink
        arrow-up
        21
        ·
        edit-2
        23 hours ago

        Did you see that ludicrious display last night??

        • OpenStars@piefed.social
          link
          fedilink
          English
          arrow-up
          14
          ·
          23 hours ago

          Yes I did. Just put it over there with the rest of the fire.

          • kambusha@sh.itjust.works
            link
            fedilink
            arrow-up
            7
            ·
            23 hours ago

            Your name is Morris Moss, is it not?

            • fedditter@feddit.org
              link
              fedilink
              arrow-up
              4
              ·
              21 hours ago

              Your name is Morris Moss, is it not?

              • fedditter@feddit.org
                link
                fedilink
                arrow-up
                3
                ·
                21 hours ago

                It is not.

      • serpineslair@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        19 hours ago

        The irony is, I remember it perfectly.

    • guillem@aussie.zone
      link
      fedilink
      arrow-up
      10
      ·
      24 hours ago

      It’s easier to remember if you sing it.

      • hakunawazo@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        21 hours ago

        A B C D E F G, I hang a noose on this tree. 𝅘𝅥𝅮𝆕

        But for real: You should reset hard the head of the git branch, not yours.

  • dream_weasel@sh.itjust.works
    link
    fedilink
    arrow-up
    7
    arrow-down
    2
    ·
    14 hours ago

    No merges allowed. Rebase only.

    • dream_weasel@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      11 hours ago

      And if you can’t figure out how to rebase, I definitely don’t want you solving your own merge commit!

  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    23
    ·
    20 hours ago
    git reset --hard <commit-hash>  
    git push -f origin main  
    

    i didn’t see anything, officer

    • martinb@lemmy.sdf.org
      link
      fedilink
      arrow-up
      17
      ·
      20 hours ago

      You should be forcibly kept away from production systems…

      • henfredemars@infosec.pub
        link
        fedilink
        English
        arrow-up
        9
        ·
        19 hours ago

        We had an intern do this once. We changed our server config to make sure it wouldn’t accept such operations.

        • gravitas_deficiency@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          5
          ·
          edit-2
          16 hours ago

          It’s just a branch guard + properly implementing git user and team permission structures - you’re not “configuring a server”

          • marcos@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            13 hours ago

            I wonder what you think “configuring” means.

      • unalivejoy@lemmy.zip
        link
        fedilink
        arrow-up
        3
        ·
        16 hours ago

        Never use --force. Always use --force-with-lease.

        • enbiousenvy@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          14 hours ago

          I’ve mistyped that a couple of times to be --force-with-leash

          • unalivejoy@lemmy.zip
            link
            fedilink
            arrow-up
            4
            ·
            12 hours ago

            git push origin master --force-with-leash

            Don’t do that to your master.

          • katy ✨@piefed.blahaj.zone
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            12 hours ago

            only do that in puppygit (with consent)

            • enbiousenvy@lemmy.blahaj.zone
              link
              fedilink
              English
              arrow-up
              1
              ·
              7 hours ago

              TIL thats a real thing https://github.com/catpuppyapp/PuppyGit

  • Echo Dot@feddit.uk
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    15 hours ago

    See I wasn’t really going to kill myself today, but the thought of dialing that long ass number is just to much.

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
    link
    fedilink
    English
    arrow-up
    13
    ·
    19 hours ago

    calls suicide hotline to ask for tech support

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      4
      arrow-down
      2
      ·
      edit-2
      14 hours ago

      Don’t hold your breath, they’re pretty mid at their actual job.

  • dubyakay@lemmy.ca
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    14 hours ago

    Google gives you results based on your prior search history.

  • jaschop@awful.systems
    link
    fedilink
    arrow-up
    34
    arrow-down
    1
    ·
    1 day ago

    It’s never too late to git merge --abort!

    • TheFriendlyDickhead@feddit.org
      link
      fedilink
      arrow-up
      23
      ·
      23 hours ago

      But abortion is murder?!?!?!?!?

      • gravitas_deficiency@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        8
        ·
        16 hours ago

        🎶 every branch is sacred 🎶

  • peoplebeproblems@midwest.social
    link
    fedilink
    English
    arrow-up
    8
    ·
    20 hours ago

    Been there too OP. Not a good place.

    It’s usually easier to find another job, it will reset your mind, and fear won’t be driving you.

    Or you could just commit what you have, comment “YOLO” and auto resolve conflicts and push.

    • tomjuggler@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      14 hours ago

      I prefer to just delete the whole .git and start a new repository with the new version. We are pivoting the project, new name and new repo

  • kubica@fedia.io
    link
    fedilink
    arrow-up
    15
    ·
    1 day ago

    git out --never-come-back

    • errer@lemmy.world
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      20 hours ago

      git never --gonna-give-you-up

      • gravitas_deficiency@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        16 hours ago

        git never --gonna-let-you-down

  • Anafabula@discuss.tchncs.de
    link
    fedilink
    arrow-up
    9
    ·
    22 hours ago

    Jujutsu (which is compatible with git) has a nice conflict resolution flow that doesn’t break you workflow.

    Conflicts are encoded into the commits, so that there is never a weird in between state that you have to deal with immediately before being able to do anything else.
    Then you can use Jujutsu’s easier history manipulation to resolve the conflict in the conflicted commits.

    https://steveklabnik.github.io/jujutsu-tutorial/branching-merging-and-conflicts/conflicts.html

    And you could always jj undo if you did something you didn’t want to.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2.15K users / day
  • 5.72K users / week
  • 9.8K users / month
  • 19.9K users / 6 months
  • 1 local subscriber
  • 26.8K subscribers
  • 1.49K Posts
  • 41.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org