How do you delete part of an existing git project and become a new one?

the gitlab, environment is private, assuming that existing project A has two files A/a.txt , A/b.txt , and has a series of operations such as commit and merge.

now a new project needs to be created due to business requirements, but the new project only needs A/a.txt , and the previous git operation record needs to be kept.

how would it be reasonable to implement?

Git
Feb.28,2021

I have never encountered this problem. After thinking about it, the train of thought should be:

  1. Clone from the original warehouse to the local: git clone original warehouse
  2. Delete b.txt
  3. hold, submit: git add & & git commit
  4. push to the newly built warehouse: git push-u.

is it supposed to be like this? Not to mention git init and git remote add .

just experimented on Github, you can delete the specified file or keep the submission record.

With

full of coquettish operations, you can convince users to open a new git library instead of the previous record of git operations. The old version is left on the original git. If you really need to check the git records, you can check the old version of the warehouse. (when you can't change the code, you can try to change the requirements

Menu