• Wilzax@lemmy.world
    link
    fedilink
    arrow-up
    26
    ·
    2 months ago

    Why learn how to use the entire swiss army knife when you can keep it closed to use it as a very small hammer?

  • sgibson5150@slrpnk.net
    link
    fedilink
    arrow-up
    15
    ·
    2 months ago

    Hey, sometimes you need to hose out the cruft.

    Why yes, I do maintain a legacy application that still stores user files in Program Files in blatent violation of 15 years of Windows best practices and continues to be done contrary to my repeated advice, why do you ask?

    • PotatoesFall@discuss.tchncs.de
      link
      fedilink
      arrow-up
      8
      ·
      1 month ago

      People inexperienced with git can get stuck after doing some funky checkout / rebase stuff. If you don’t know your way around git so well, I guess this is the obvious solution.

    • SirQuackTheDuck@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      2 months ago

      I’ve been doing this yesterday. Not because Git broke, but since Intellij kept pulling invalid configs from the cache, and that was based on some kind of path identifier it seemed.

    • Johanno@feddit.org
      link
      fedilink
      arrow-up
      3
      ·
      2 months ago

      Gradle!

      Fucking gradle. I do config stuff, rerun gradle error here, I fix the error rerun gradle: sth. Violation error.

      Ok intellij invalidate chaches and restart… Still same error.

      Fine I’ll do it again

      git add. 
      git commit -m "stuff"
      git push
      
      rm -rf repo
      git clone repo
      
      • iammike@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        2 months ago

        You can probably use something like

        git clean -xdf
        

        To get rid of all the artifacts not tracked by git, in this case it’s virtually the same as deleting the repo and re-cloning it.

        NOTE: Make sure everyhing is staged, otherwise that data is gone

    • JPDev@programming.devOP
      link
      fedilink
      arrow-up
      21
      ·
      edit-2
      2 months ago

      git rm -rf is only usable within the scope of the git repository and removes files in the staging area and working directory but doesnt affect untracked files or .git. rm -rf affects everything. For this case rm -rf probably would be the better option

      edit: did a quick edit on the meme to change it to rm -rf since it makes more sense

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    2 months ago

    Delete container, rebuild container. Sometimes it’s just useful to clean up all the mess of cache files