More Git Fun

Messing with getting abandoned git repo back into use… again!

Local files are not tracked by git at all so first initialize repo and add remote origin.

Then:

Make a new branch with the local files:

git checkout -b staging

Get the remote files:

git checkout master

Really destructively replace all files in master with those in staging:

git reset --hard staging

Show all the changed files, aside from those in .gitignore:

git ls-files -o --exclude-standard

Return all the changed files, aside from those in .gitignore and delete them:

git ls-files -o --exclude-standard | xargs rm

This is funny.