Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@mander.xyz to Programmer Humor@programming.dev · 2 days ago

When you have to checkout the master branch

lemmy.world

message-square
41
fedilink
444

When you have to checkout the master branch

lemmy.world

cm0002@mander.xyz to Programmer Humor@programming.dev · 2 days ago
message-square
41
fedilink
  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    43
    ·
    2 days 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.

    • Scrollone@feddit.it
      link
      fedilink
      arrow-up
      1
      ·
      9 hours ago

      I agree, I wonder why they decided to design it that way in the first place.

    • rhabarba@feddit.org
      link
      fedilink
      arrow-up
      14
      ·
      2 days ago

      Ah, I love coherent software.

      • sik0fewl@lemmy.ca
        link
        fedilink
        arrow-up
        12
        ·
        2 days ago

        Switch and restore came later because checkout was problematic.

        • nightlily@leminal.space
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          1 day ago

          Has someone made a „Checkout considered harmful“ blog post yet or do we not do that anymore?

          • anomnom@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 day ago

            E we used to always stash before checkouts to try and find things in a branch

      • SleeplessCityLights@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        Just alias stuff like that, make it coherent.

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: [email protected]

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.

  • 448 users / day
  • 4.54K users / week
  • 8.84K users / month
  • 18.3K users / 6 months
  • 1 local subscriber
  • 27.8K subscribers
  • 2K Posts
  • 70.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org