user482594
user482594

Reputation: 17486

How can I update the project files using git effectively?

I have an old web application 'A' which is a running under version control of git.

I recently rewrote the whole structure, but wrote this in different place and this new files are not under version control of git. This new project is 'B'

What is a best way that I can commit 'B' to the git repository that is keep tracking of 'A'?

No contents in git repository 'A' will be needed because everything is in 'B', but I want 'B' to use the git repository that 'A' have been using.

Do I just force commit in this case?

Upvotes: 2

Views: 94

Answers (2)

Daniel May
Daniel May

Reputation: 8236

If you delete the contents of A, then copy over the contents of B into A, you will have all of your removes, unversioned files and modifications still tracked under git.

Simply commit these changes and you'll have your history linear and correct.

Upvotes: 3

greg0ire
greg0ire

Reputation: 23265

I think you should copy B over A's working tree, then do all the commits you want in A until there's nothing left to be commited.

Upvotes: 0

Related Questions