Sebi
Sebi

Reputation: 4532

"Refreshing" a cloned repo using git

Context:

Is there a way to undo the state of the project after build using git? only a subset of the output files is of interest and the others can be ignored but, as it stands, these files are not easy to find.

Can the state after build be reverted to the clean state (after clone)?

One solution would be to add the generated files to a separate branch and work on that. Once built, the project is too large to be pushed to the repo.

Is there another way?

Run:

git clean -d . -f 

where

Upvotes: 0

Views: 40

Answers (1)

online Thomas
online Thomas

Reputation: 9401

What you're looking for is git clean.

Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.

Don't forget to look at the documentation to know what flags to use. There is even a dry-run to test before removing things you didn't want to be removed.

Upvotes: 3

Related Questions