git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cloning or pushing only files that have been updated
@ 2015-04-25 21:17 cl
  2015-04-25 21:54 ` Johannes Sixt
  0 siblings, 1 reply; 2+ messages in thread
From: cl @ 2015-04-25 21:17 UTC (permalink / raw)
  To: git

Hi,

I have two sets of files.

A_Old is a large unversioned directory tree containing many files.

A_Updated is a git repository containing the files from A_Old, some of
which have been modified. A_Updated also contains new files.

I am looking for a way of cloning only the new or modified files from
A_Updated to A_Old. I would like A_Old to become a clone of A_Updated,
however I don't want to download the entire archive because of access
speed issues.

Timestamps on all files are accurate.

Any ideas?

- J

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cloning or pushing only files that have been updated
  2015-04-25 21:17 Cloning or pushing only files that have been updated cl
@ 2015-04-25 21:54 ` Johannes Sixt
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Sixt @ 2015-04-25 21:54 UTC (permalink / raw)
  To: cl; +Cc: git

Am 25.04.2015 um 23:17 schrieb cl@qgenuity.com:
> I have two sets of files.
>
> A_Old is a large unversioned directory tree containing many files.
>
> A_Updated is a git repository containing the files from A_Old, some of
> which have been modified. A_Updated also contains new files.
>
> I am looking for a way of cloning only the new or modified files from
> A_Updated to A_Old. I would like A_Old to become a clone of A_Updated,
> however I don't want to download the entire archive because of access
> speed issues.
>
> Timestamps on all files are accurate.

1. Create a commit from the files in each of the directories.

2. Use git rev-list --objects --all | sort to generate a sorted list of 
objects in each of the repositories.

3. In A_Old, generate a pack from the objects that are not in A_Updated 
using 'comm' of the objects lists piped into git pack-objects.

4. Transfer this pack from A_old to A_Updated.

5. Use git fast-export --no-data in A_old.

6. Use git fast-import in A_Updated to import the commit that you have 
in A_Old into A_Updated.

7. In A_Updated, git reset --soft the-commit-from-A_Old && git commit. 
Now you have a second commit with the updated state.

8. Use git-remote to connect the two repositories and to push or pull 
the updated state.

-- Hannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-25 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-25 21:17 Cloning or pushing only files that have been updated cl
2015-04-25 21:54 ` Johannes Sixt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).