Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to delete the submission record of a file from github

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to delete the submission record of a file from the github". The explanation in the article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to delete the submission record of a document from the github".

First, when we make an error and submit the account and password to github, for example, to the abc.txt file:

You can first modify the abc.txt file to remove the account password, and then submit.

Then delete the history of the abc.txt file.

Here's how to delete the history of abc.txt files.

Second, delete the history of the file.

According to the github help documentation, there are two ways to delete the history of a file.

How to use the git filter-branch command.

Use the BFG open source tool.

Because BFG open source tools are relatively fast, I'll use this approach below. The steps are as follows:

1. Download the jar package of BFG.

Go to BFG's official address to download: https://rtyley.github.io/bfg-repo-cleaner/

2. Clear all the local warehouses.

For example, if I want to delete the history of the abc.txt file of the https://github.com/xxxx/deleteFile.git library, I am actually rewriting the history of the deleteFile.git repository.

You need to remove all the code downloaded by clone elsewhere. Avoid pull conflicts elsewhere after deleting the history of the abc.txt file.

3. Execute the following commands in turn. # pull replacement code mirror $git clone-- mirror https://github.com/xxxx/deleteFile.git# deletes the history of abc.txt $java-jar bfg-1.13.0.jar-- delete-files abc.txt deleteFile.git$ cd deleteFile.git$ git reflog expire-- expire=now-- all & & git gc-- prune=now-- aggressive# is pushed to the remote warehouse $git push. Thank you for reading. The above is the content of "how to delete the submission record of a file from the github". After the study of this article, I believe you have a deeper understanding of how to delete the submission record of a file from the github, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 251

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report