• Archr@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 days ago

      git commit --amend --no-edit and git push --force-with-lease

      No-edit skips opening an editor for the commit message and just reuses the same message.

      Force-with-lease will force push but only if your local is not missing commits that remote has. Ie other people haven’t pushed anything since you last pulled.

    • wpb@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 day ago

      If you’re comfortable with whatever text editor git uses, give git rebase -i a try.

    • Gonzako@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      Would this also trigger (git rev-parse) to change? I have CI/CD listening to changes on the master branch

      • Holla@feddit.org
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        3 days ago

        When you have to amend a commit that you have already pushed you have to force push the amendment. That should then trigger the Pipeline

        • tyler@programming.dev
          link
          fedilink
          arrow-up
          5
          ·
          3 days ago

          –force-with-lease though, not just force… It’s a good habit to have because then when you are working with other people you won’t fuck everything up.

          • doppydrop@lemmy.ca
            link
            fedilink
            arrow-up
            2
            ·
            3 days ago

            This is good advice, I got too used to being a solo dev that once I worked with a larger team… mistakes were made.

        • Gonzako@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          Well, prod is luckily the people I have next room. I made the setup so changes get uploaded quickly. I could do branches and all that stuff?

          Yeah, but i’d rather not work to work and just get it out the door. What my setup is for is that changes get pulled off the master branch and deployed without an apparent interruption of service.

          I see collaboration tools just the same as abstractions, you don’t use them just to use them. They need to solve a problem.

      • VibeSurgeon@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 days ago

        Well, there’s your problem.

        Get yourself a nice button/endpoint you can hit to trigger CI/CD that way instead

        • Gonzako@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          You’re saying it’s a problem but i’m not really reading why. While the idea of a massive button to push changes is fun having the master branch be production is a concrete idea i’ve grown fond of, iteration is fast, both at testing and deployment.