How to Remove Secrets from Git History

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024

ความคิดเห็น • 39

  • @ClaudioBernasconi
    @ClaudioBernasconi  3 ปีที่แล้ว +1

    Do you have any other tips and tricks for using Git?

  • @Trapson
    @Trapson 3 ปีที่แล้ว +2

    I really needed this. Worked flawlessly, thank you

  • @harishkumarkr8172
    @harishkumarkr8172 3 ปีที่แล้ว

    Nice ,
    Can we remove the secret key from specific branch ?

    • @ClaudioBernasconi
      @ClaudioBernasconi  3 ปีที่แล้ว

      Using this method you should be able to remove the secret key from any branch present in your repository. I don't know why you would want to remove it only from a single branch but if it's the same key, it will be removed from all branches. I suggest making a copy of your repository, trying it to see if the result suits you and if you don't like it, you can use the copy before applying this command.

  • @CofiRazak
    @CofiRazak ปีที่แล้ว

    Awesome, thank you very much!

  • @danilovieirarocha8578
    @danilovieirarocha8578 2 ปีที่แล้ว

    great video friend, it helped me a lot
    greetings from Brazil

  • @timweiss9280
    @timweiss9280 2 ปีที่แล้ว

    Great tip. I didn't want the default ***REMOVED*** as the text replacement so I used in my .TXT file :
    OLDTEXT==>NEWTEXT
    and the NEWTEXT was now in all files and history!!

  • @dioxino76
    @dioxino76 5 หลายเดือนก่อน +1

    I prefer not using another tool with my passwords: the less tools are used to manage them, the more secured will be my passwords.

    • @ClaudioBernasconi
      @ClaudioBernasconi  5 หลายเดือนก่อน

      Where do you store your passwords? All in your mind? Or do you use the same password for different services?

  • @paulhere404
    @paulhere404 ปีที่แล้ว

    Hello, What's the UI you are using in this video? Thanks

    • @ClaudioBernasconi
      @ClaudioBernasconi  ปีที่แล้ว +1

      The GUI Git client I'm using here (and still to this date) is called SourceTree (by Atlassian).

  • @sleslie321
    @sleslie321 2 ปีที่แล้ว

    brilliant video - really helped thanks

  • @pasmetha
    @pasmetha ปีที่แล้ว

    You are awesome!!!!!! THANK YOU

  • @lucianosilva3595
    @lucianosilva3595 2 ปีที่แล้ว +1

    THANKS BRO!!!

  • @seanwauchope
    @seanwauchope 3 ปีที่แล้ว

    Boom! Done TY!

  • @MooNight008
    @MooNight008 11 หลายเดือนก่อน

    Still working flawlessly

  • @RebelionDNA
    @RebelionDNA 2 ปีที่แล้ว

    I used the same method as you described, but it replaced every text of the file with ***REMOVED***, I'm not sure how to make it so it will replace only the specific word with ***REMOVED***. How can i achieve that?

    • @ClaudioBernasconi
      @ClaudioBernasconi  2 ปีที่แล้ว

      I'm sorry, I don't know what you're doing wrong. I suggest posting on StackOverflow.

  • @AdityaYada
    @AdityaYada 9 หลายเดือนก่อน

    what about merged pull requests ? can we clean that too?

    • @ClaudioBernasconi
      @ClaudioBernasconi  9 หลายเดือนก่อน +1

      Great question. Pull requests are not part of Git. You're most likely referring to Bitbucket, Gitlab or GitHub. If you talk about branches, yes you can also remove secrets from different branches than you main or master branch.

  • @varun_
    @varun_ 2 ปีที่แล้ว

    I was able to see my changes in github desktop but, it's not moving into github repo, any idea on this?

    • @ClaudioBernasconi
      @ClaudioBernasconi  2 ปีที่แล้ว

      You maybe have to push the changes from your local repository to the remote repository located on the GitHub server. You might need to use the push -f (force) command if you changed the history of the branch. However, be careful with using force and learn about it (maybe in a spare repo) before you apply it to an important repository. If you have further issues, I suggest asking in a forum or StackOverflow and providing more detail about what you did, what you want to achieve and why it doesn't work as expected. I hope this help. Thanks for watching.

  • @Fangh44
    @Fangh44 ปีที่แล้ว

    do you have a video to do the same but for a file ? like a png ? to remove it entierly ?

    • @ClaudioBernasconi
      @ClaudioBernasconi  ปีที่แล้ว

      You can do that with rebase. But you need to be careful. Rebasing leads to a repository that has to be cloned again by all developers. If you do not know about rebase, ask a friend or co-worker for further guidance. If it's a private project, make a copy of the repo and try it out. This SO post tells you how to do it: stackoverflow.com/questions/43762338/how-to-remove-file-from-git-history

  • @ivanryakhov300
    @ivanryakhov300 3 ปีที่แล้ว

    Thank you for the tip

  • @muhammetaydinn
    @muhammetaydinn 3 หลายเดือนก่อน

    which program is that blue program

  • @HernaniSamuel
    @HernaniSamuel 3 หลายเดือนก่อน +1

    I forgot to add the .env in gitignore and all my credentials went to the local and remote repository... At least there's only me in the project and the remote repository is private 😅

    • @ClaudioBernasconi
      @ClaudioBernasconi  2 หลายเดือนก่อน +1

      Yeah that happens to all of us. Great you were able to fix your issue.

  • @SiLiDNB
    @SiLiDNB 2 หลายเดือนก่อน

    merci viu mau :)