0

Noob at Git version control here.

I have a repository, currently with one branch named "master". It has the code pertaining to the repository, obviously. Now I have made a different implementation of the same code, but I would like to maintain them in the same repository, but in completely different branches. They will even have separate README files. They will never be merged.

I tried creating a new branch "B" and renamed the "master" branch to "A", checked out to B, added the new files individually to the new branch and pushed them, but when I checked my repository it had all the old files + my new files in the new branch. I just want the new files in the new branch. I'm at a complete loss what to do.

I'm doing all this experimentation in a private test repository so there are no actual permanent changes.

Any help would be appreciated.

MUSTANGBOSS8055
  • 69
  • 4
  • 11
  • Presumably the readme file was added in the first commit. If that's the only commit that is supposed to be shared between the two branches, then create the second branch from that commit, instead of the latest commit in the first branch. – mkrieger1 Oct 15 '21 at 21:43
  • @mkrieger1 the new branch is absolutely independent of the old one. Think of it like the old branch being a codebase in python and the new one in C++. – MUSTANGBOSS8055 Oct 15 '21 at 21:46
  • Oh sorry I misread the part about the readme file. – mkrieger1 Oct 15 '21 at 21:46

0 Answers0