version control - Git - remove and exclude configuration file -


2 weeks ago, I configured my application, which contained my password, it is not very useful. How can I extract the file from alleged history and make sure that it can not be used again?

I want to remove the file from all the cutt trees because my password is included in it.

you can

  git rm myConfigFile echo myConfigFile & Gt; Guidgear GIT Ad GTinter GIT Commit-M "From now on, my config file is no longer"  

Other extreme approaches (especially dangerous if you have already pushed your repo on a remote) that file Completely said to be removed from the history of the repo:

  git filter-branch --index-filter 'git update-index --remove myConfigFile' head  
< P> (to use with care, and with the first backup)

The question is more about that sensitive subject.

The problem of this process is two times:

  1. If your repo is already cloned, you can never guarantee that the confidential information is actually Every other repo in "will go away"
  2. When others try to remove their latest changes after this, they will receive a message indicating that changes can not be applied because it is not fast forward.
    To fix this, they have to either delete their existing repository and clone it again, or follow the instructions given under " Recover from Upstream rebase ". In both cases, your confidential information will not be "silently" replaced or deleted ...

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -