1

I have an existing source-tree, with a bunch of sub-directories and thousands of source files. I have a new source-tree where some of the files have been updated and some new files/directories added.

The existing source-tree has a bunch of hidden sub-directories (.git) which the new source-tree lacks.

I'm looking for a way for all the updated and new files to find their way from the new source-tree to the existing. I don't mind for the similar files to be copied as well because it would have no adverse effect.

Flyk
  • 1,549
  • 1
  • 22
  • 28

1 Answers1

1

The first thing that comes to mind is rsync:

rsync -va /path/to/new/tree/ /path/to/existing/tree

The trailing slash on the first path is vital. Without it, a new tree folder will be created under /path/to/existing/tree, creating the path /path/to/existing/tree/tree.

This command will update the files in the existing tree with the files from the new tree.