Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
246 views
in Technique[技术] by (71.8m points)

git - How to delete unwanted commit files

I am new to git functions and I wrote a set of code, I intend to push it to Github but my commit report is showing over 5000 files, I do not know where such heavy set of commits emanated from. Please help!

The image for the commit box is shown below:enter image description here

question from:https://stackoverflow.com/questions/65917831/how-to-delete-unwanted-commit-files

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have a lot of files in folders you do not want to be pushing. The .cache folder for example. You can fix this by creating a .gitignore file containing the paths that you don't want to push.

For example, to add the .cache folder to .gitignore, you can use.

.cache

Figure out which files you want to push to github, and which you should not be pushing. Also, if you have already pushed any files to the repo that are included in the .gitignore, you will need to remove them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...