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.
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!!
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?
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.
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.
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
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 😅
Do you have any other tips and tricks for using Git?
I really needed this. Worked flawlessly, thank you
Glad it helped you.
Nice ,
Can we remove the secret key from specific branch ?
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.
Awesome, thank you very much!
great video friend, it helped me a lot
greetings from Brazil
Thanks a lot! 👍
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!!
Great to hear it worked for you, Tim.
I prefer not using another tool with my passwords: the less tools are used to manage them, the more secured will be my passwords.
Where do you store your passwords? All in your mind? Or do you use the same password for different services?
Hello, What's the UI you are using in this video? Thanks
The GUI Git client I'm using here (and still to this date) is called SourceTree (by Atlassian).
brilliant video - really helped thanks
Thank you. 🙏
You are awesome!!!!!! THANK YOU
You are awesome too! Thank you. 🙃
THANKS BRO!!!
Happy to help.
Boom! Done TY!
Still working flawlessly
Glad to hear! 👍
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?
I'm sorry, I don't know what you're doing wrong. I suggest posting on StackOverflow.
what about merged pull requests ? can we clean that too?
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.
I was able to see my changes in github desktop but, it's not moving into github repo, any idea on this?
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.
do you have a video to do the same but for a file ? like a png ? to remove it entierly ?
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
Thank you for the tip
Thanks for watching. 😎
which program is that blue program
Sourcetree? 🤔
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 😅
Yeah that happens to all of us. Great you were able to fix your issue.
merci viu mau :)
@@SiLiDNB thx