简体   繁体   中英

Are all versions of code available when I push to github

I'm still new with git, so please correct me if I'm using the wrong terminology.

I want to push a project to github. However, when I initialized the project, I added some files with sensitive information (database passwords). I have since removed the files and commited the change.

If I push my code to github, will the older versions with the sensitive information be available? Or does it only push the current version?

Yes, even though you deleted it, older versions of the sensitive files will still be available. Use this guide to purge all versions of those files from the repo.

If you committed the files with the sensitive information, then yes. The entire repository from your machine will be copied to github - and every file you have ever committed is in the repository on your machine.

If you want to keep the whole history on github except for those files, you can use purge . Or, you could start a new repository based on the current state of the files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM