DIGITALFALL
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Phoenix3875@lemmy.world to Programmer Humor@programming.devEnglish · 2 years ago

One command to rule them all

lemmy.world

message-square
21
link
fedilink
229

One command to rule them all

lemmy.world

Phoenix3875@lemmy.world to Programmer Humor@programming.devEnglish · 2 years ago
message-square
21
link
fedilink
alert-triangle
You must log in or register to comment.
  • Ocelot@lemmies.world
    link
    fedilink
    arrow-up
    73
    arrow-down
    3
    ·
    edit-2
    2 years ago

    fuck it. rm -rf repository; git clone repository

    Been using git since almost as long as its been around, still can’t be bothered to learn to how to fix conflicts.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      18
      ·
      2 years ago

      Rename it, so you can run diff on those surprising things that in no way could have changed, but are not equal to the repository. And then delete.

      Or keep the X-old; X-backup; X-bkp; X-old-old; X-old3 dirs.

  • mvirts@lemmy.world
    link
    fedilink
    English
    arrow-up
    50
    ·
    edit-2
    2 years ago

    mv .git .git_old7

    git init

    git add .

    git commit -m “almost working”

    • minorsecond@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 years ago

      Lmao this is perfect

  • joyjoy@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    ·
    2 years ago

    Neither remove untracked files sadly.

    • sickday@kbin.social
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      2 years ago

      git stash my friend

      • BlueBockser@programming.dev
        link
        fedilink
        arrow-up
        17
        arrow-down
        1
        ·
        2 years ago

        I think git clean is more appropriate. With git stash you create a stash which you then have to drop.

        • HairHeel@programming.dev
          link
          fedilink
          arrow-up
          37
          ·
          2 years ago

          Who says you have to drop it? I’ve got stuff from 2007 in there somewhere.

          • BlueBockser@programming.dev
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            2 years ago

            Of course you don’t have to, but if you don’t plan on ever using it then it’s just trash living in your git folder. If you do plan on using it again in the future, then it’s usually better to make it a branch so you can push it to a remote.

        • sickday@kbin.social
          link
          fedilink
          arrow-up
          9
          ·
          2 years ago

          Yea but you can always git pop if you need any of your stashed changes

          • Ocelot@lemmies.world
            link
            fedilink
            arrow-up
            8
            ·
            2 years ago

            i chuckled at the thought of ‘git poop’ being a command. I’m going to alias that to something.

            • PoastRotato@lemmy.world
              link
              fedilink
              arrow-up
              9
              ·
              edit-2
              2 years ago

              You could make it run git pop until it clears the whole stash

    • slampisko@czech-lemmy.eu
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      That’s why I follow it with git clean -fd

  • Sonotsugipaa@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    1
    ·
    2 years ago

    git restore . ?
    Or am I misinterpreting the problem?

    • static_motion@programming.dev
      link
      fedilink
      English
      arrow-up
      18
      ·
      2 years ago

      git restore is a pretty new command AFAIK. Those of us who learned git before its existence have probably stuck to the old ways of git reset --hard.

      • TheSealStartedIt@feddit.de
        link
        fedilink
        arrow-up
        3
        ·
        2 years ago

        Yep, I just learned of this command…

  • girltwink@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 years ago

    alias mybad=‘git add -u && git commit --amend --no-edit && git push --force-with-lease’

    • zexu@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      😂😂😂

  • Synthead@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 years ago

    And lose my untracked changes?

    https://m.youtube.com/watch?v=guv5LUT1AFw&t=7s

  • niyrme@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    git stash

  • Martin@feddit.nu
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 years ago

    That is stupid. Those commands are for different use cases.

  • vegai@suppo.fi
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 years ago

    deleted by creator

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.

  • 1.36K users / day
  • 4.84K users / week
  • 9.19K users / month
  • 17.6K users / 6 months
  • 1 local subscriber
  • 23.2K subscribers
  • 1.39K Posts
  • 50.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org