f



Copy files and ensure that the modified files are not be overwritten.

Hi all,

Currently, I meet a the following problem:

Suppose I have some folders with some files in each of them.  Now, I copy 
all of these folders into another location and then make some changes, 
e.g., edit/remove/rename and so on, for some of the files/folders in the 
old and new location.  

After that, I want to merge them as one with all of the differences leave 
as they are, is this possiable?

Regards.
-- 
..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
0
hszhao.cn (87)
5/16/2011 1:32:25 AM
comp.unix.shell 15484 articles. 3 followers. Post Follow

2 Replies
434 Views

Similar Articles

[PageSpeed] 29

Hongyi Zhao <hszhao.cn@gmail.com> writes:

> After that, I want to merge them as one with all of the differences leave 
> as they are, is this possiable?

The above constraint seems self-contradictory as phrased. But I suspect
what you're looking for is ‘rsync(1)’, available from any GNU+Linux or
BSD operating system.

-- 
 \                “Science doesn't work by vote and it doesn't work by |
  `\        authority.” —Richard Dawkins, _Big Mistake_ (The Guardian, |
_o__)                                                      2006-12-27) |
Ben Finney
0
unix49 (48)
5/16/2011 2:06:12 AM
On Mon, 16 May 2011 01:32:25 +0000, Hongyi Zhao wrote:

> Hi all,
> 
> Currently, I meet a the following problem:
> 
> Suppose I have some folders with some files in each of them.  Now, I
> copy all of these folders into another location and then make some
> changes, e.g., edit/remove/rename and so on, for some of the
> files/folders in the old and new location.
> 
> After that, I want to merge them as one with all of the differences
> leave as they are, is this possiable?
> 
> Regards.

Yes it is possible. One approach is to use something like unison
  http://www.cis.upenn.edu/~bcpierce/unison/ 
to do it. It will not allow you to merge files that you have changed in 
both places.

These days there is a lot of interest in "Distributed Version Control" 
which allows you to have multiple copies of sets of files, and pull (or 
push) changes between them. The one I use most is mercurial (also known 
as 'hg') http://mercurial.selenic.com/ which is simple to set up. 
Probably the most famous is 'git', and probably the most interesting is 
'darcs'.
0
un193 (82)
5/16/2011 2:22:16 PM
Reply: