[Tutorial] How to remove all Git commit record git repository, and become a new, clean warehouse

I. Introduction

  Masan can be considered a loyal user of Github, and often put some of the practiced hand of Github project reached the top backup. There is a named ColaFramework Unity framework of the project, Umazo developed more than a year, during the time of submitting the code to upload some of the more sensitive information in the Log, the information can be searched at Github above, Masan want the Log information removed, so that it becomes not submit a record of "new warehouse." So I found online, step quite simple, direct follow a step by step operation on it.

Second, the steps

  1. Switch to the new branch

git checkout --orphan latest_branch

  2. Cache all files (except .gitignore declared excluded)

 git add -A

  3. Submit file tracking off (Commit the changes)

 git commit -am "commit message"

  4. Remove the master branch (Delete the branch)

git branch -D master

  5. Rename current branch to master (Rename the current branch to master)

 git branch -m master

  6. Submit to the remote master branch (Finally, force update your repository)

 git push -f origin master

  History may simply submit a Git repository of record by more than a few steps removed, but still the best in the usual stringent requirements about the development of specifications submitted by the log, try to avoid entering sensitive information in it came.

 

 

 

 

If you think this blog is helpful to you, you can scan the code a little to encourage dismount three Umazo will write more good articles, support micro-channel and Alipay yo!

       

 

Author: Masan small group of children
Source: https://www.cnblogs.com/msxh/p/11082246.html 
please respect the labor of others, makes sharing became a virtue, welcome to reprint. In addition, articles in terms of presentation and code if wrong, welcome criticism. Leave your footprints are welcome to comment!

 

Guess you like

Origin www.cnblogs.com/msxh/p/11082246.html