user13955
user13955

Reputation: 870

git - use of branches as backup

I have a git archive which contains my dev code. Before pushing this into production, I need to delete quite a few unused source files. However, I want to keep those file around for reference.

So my thought is to create a branch of the current code and delete the unneeded files from HEAD. This would allow me to continue development under HEAD and still have the unneeded files for reference in my branch should I ever need them.

Does this seem like a valid approach or would I be mis-using branches if I did it this way?

Upvotes: 2

Views: 469

Answers (1)

Nick Volynkin
Nick Volynkin

Reputation: 15119

Yes, that would be a misuse of branches. There are two better options:

  1. Commit with some standard message (e. g. "cleanup" )
  2. git tag -m"feature_name cleanup"

Upvotes: 1

Related Questions