git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: cl@qgenuity.com
Cc: git@vger.kernel.org
Subject: Re: Cloning or pushing only files that have been updated
Date: Sat, 25 Apr 2015 23:54:36 +0200	[thread overview]
Message-ID: <553C0D1C.2010301@kdbg.org> (raw)
In-Reply-To: <054116d47b69ca56f3369369df9fb4d8.squirrel@www.qgenuity.com>

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

      reply	other threads:[~2015-04-25 21:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 21:17 Cloning or pushing only files that have been updated cl
2015-04-25 21:54 ` Johannes Sixt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553C0D1C.2010301@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=cl@qgenuity.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).