given an existing repo, I want to (re)init it from scratch, i.e., delete all its history and push it to the server (here, GitHub). Since GitHub has a hard 100MB file size limit and the folder contains various very large files, I cannot simply perform an git add .
. What would be an easy way that does not involve manually gathering a list of all these large files?
My idea would be to invoke the following commands (taken from https://gist.github.com/stephenhardy/5470814) but as said above, the gid add .
seems infeasible in this case.
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add . # <-- without large files!
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
git push -u --force origin master