bluelovers
bluelovers

Reputation: 1265

any way remove history commit but keep all file 1 log?

I have a git repo with a same file has many log

df5bf4b a.file
c1f6f9f a.file
4e818fa b.file
f954acf b.file

I wanna remove old logs but keep at last one commit log on each files

for reduce git repo size

how can i do this?

df5bf4b a.file
4e818fa b.file

Upvotes: 0

Views: 46

Answers (1)

Jake Dube
Jake Dube

Reputation: 2990

Assuming you do not have any other files in your repository that you want to keep other versions of, you can do this by deleting the git repository, initializing a new one, then making a commit. Something like this:

cd your_project_root_directory/
rm -rf .git/
git init
git add *.file
git commit -m "Add files"

Upvotes: 2

Related Questions