How to Completely Remove .env/secrets File from Github Repository When Pushed By Mistake

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

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

  • @bhargavkumar
    @bhargavkumar ปีที่แล้ว +14

    Bro it's literally 1 AM and I was frustrated with all of these things. Because of this video I am going to get a good night sleep. Thanks Brother❤❤

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

      These kind of comments make me happy, don't forget to subscribe 🙏🏻

    • @InnocenceVVX
      @InnocenceVVX 4 หลายเดือนก่อน

      Haha this is so relateable

  • @true227
    @true227 3 หลายเดือนก่อน +2

    Guys, if your env file is nested into folder front or server , you should to write full path , fro example git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch front/.env" HEAD

  • @shadowzone6469
    @shadowzone6469 7 หลายเดือนก่อน +16

    git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD

    • @lorewired
      @lorewired 4 หลายเดือนก่อน

      ty

  • @user-yr9zs6sr9d
    @user-yr9zs6sr9d ปีที่แล้ว +1

    thanks man. best and most simple tutorial on the internet :). this works with any type of file, not just .env - So you could probably change your title

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

      Glad you liked it, I appreciate your feedback! And I know but I've made this tutorial specifically for env file

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

    Thanks work delete .env from repository

  • @m0-s7
    @m0-s7 ปีที่แล้ว +1

    thanks bro u saved my time

  • @100xcoding
    @100xcoding หลายเดือนก่อน

    Thanks it really helps

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

    Thanks so... much. it was very helpful

  • @c._vylly
    @c._vylly 5 หลายเดือนก่อน

    In my case the secret is in filesystems file, is it overall .env?

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

    Wow life saviour , thanks dude

  • @abigiyatadesse2672
    @abigiyatadesse2672 10 หลายเดือนก่อน +1

    Thank you this is really helpful.

    • @devstuff92
      @devstuff92  10 หลายเดือนก่อน

      Awesome! Show support by liking, sharing and subscribing🙏🏻

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

    Thank you mate, appreciate your work

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

      Thank you for the support

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

    how did you get suggestion/recommandation when writting in the terminal ?

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

      Using Powershell v7.3.5, it gets integrated with vscode automatically

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

    Thank u bro, this is the one ive been looking for.

  • @SadrachHarmasantyo-n5j
    @SadrachHarmasantyo-n5j 8 หลายเดือนก่อน

    bro can u help me. i already deploy my webiste on netlify with my .env file in there and suddenly when i follow ur steps to hide the .env files, my website that has been deployed before crash because cannot read my api key on .env file

    • @greenweed3253
      @greenweed3253 7 หลายเดือนก่อน

      I am hosting my website on AWS EC2, It is still running my website using the old version of my git repository which had .env file. So if something like this is possible in netlify, then you can try that.

  • @sohail21400
    @sohail21400 4 หลายเดือนก่อน

    Bro, you saved my life!

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

    Thanks, Man! Super helpful👍

  • @weiwei2694-q2h
    @weiwei2694-q2h ปีที่แล้ว +1

    Thankyou man

  • @minthant65820
    @minthant65820 10 หลายเดือนก่อน

    bro's a lifesaver!

  • @Axpsi
    @Axpsi 7 หลายเดือนก่อน

    Man. You really going to Heaven for this

  • @prithvijitbasak
    @prithvijitbasak 6 หลายเดือนก่อน

    Thanks for the help 🤝

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

    Life saver, thank you!

  • @SadrachHarmasantyo-n5j
    @SadrachHarmasantyo-n5j 8 หลายเดือนก่อน

    bro can you help me. i already deploy my app with my .env in there and suddenly when i follow your steps my website that i was already deploy cannot read my api key in my .env files

    • @sihsuya
      @sihsuya 3 วันที่ผ่านมา

      did u ever fix this?

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

    what if it's not a single file but rather a folder that I accidentally pushed?

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

      git rm -r --cached folder_name
      git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch folder_name" HEAD
      git push --force

  • @dyegooliveira307
    @dyegooliveira307 26 วันที่ผ่านมา

    Thank you!!

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

    Awesome, thank you!

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

      Sure thing!

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

    Thanks, brother. Very helpful!

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

    This is really helpful man I appreciate it!

  • @iakovryzhichka2832
    @iakovryzhichka2832 11 หลายเดือนก่อน +1

    my hero!

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

      Glad it helped you!

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

    you're a top g. great video

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

    superr

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

      Subscribe for more, new video soon!

  • @JohnDoe-to8vr
    @JohnDoe-to8vr 5 หลายเดือนก่อน

    thank you very much

  • @paulo_xml
    @paulo_xml 4 หลายเดือนก่อน

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

    Thank you so much!

  • @lorewired
    @lorewired 4 หลายเดือนก่อน

    thank you

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

    thanks

  • @F-xq6rp
    @F-xq6rp 7 หลายเดือนก่อน

    thanks a bunch

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

    love you

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

    Thanks dude

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

      Sure thing, plenty more to come. Make sure to subscribe

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

      @@devstuff92 yep

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

    how to reverse this I had problem in it

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

      First, make sure you have a backup of your repository in case anything goes wrong.
      git push --force origin
      If you no longer have the original branch and need to restore it, you can recreate the branch from the commit that existed before the removal process. Identify the commit hash of the commit that you want to restore and run the following command:
      git branch
      git push origin

  • @InnocenceVVX
    @InnocenceVVX 4 หลายเดือนก่อน

    Thanks so much!