Neil W
Neil W

Reputation: 9247

Reset Git Repository for Visual Studio Solution

I've been using Git (with GitHub) in Visual Studio, but have not used it particularly elegantly in terms of branches, etc. I've just been maintaining the master.

That was fine during early development, but now I have a stable version 1 I want to reset my Git repository. I want to remove all old commits so that I have just the first version there, which can label/tag as V1 and then use branches correctly going forward.

How do I go about resetting / removing all old commits?

I guess I could:

But, is there a way to just reset without deleting and re-creating the repo?

Upvotes: 2

Views: 1728

Answers (1)

Laurenz Honauer
Laurenz Honauer

Reputation: 344

As Franz Gleichmann is stating, there is no real point in getting rid of your history.

If you just want to clearly mark the V1 Commit you could simple make use of Git Tags

If your goal is to make the past a secret you could pull your master Squash all commits there and then push again. If your repo is public you can (and probably should) set up rules to prevent future pushes on the master

Upvotes: 1

Related Questions