1

Hope somebody can help with this, as it may be the blocker to us switching our dev environment to use git.

We will have several git repos in a shared, networked environment. Pretty standard usage of git. However, we also have the need to have an isolated environment that source will need to replicated to. This is basically accomplished via burning a CD and taking the source into the environment. Some of our codebases are quite large, so our CM folks do not want to have to replicate the whole repo every time the source needs to be taken into the closed environment.

We currently use ClearCase and it has the ability to export deltas, along with the commit information, from the external repo, and then import it into the isolated repo. Code will never leave the isolated repo to be re-imported into the external repos.

Is this capability available in git? I.E. on the external repo, export changesets, burn those onto a CD, take them into an isolated environment and apply those changesets (along with commit info) to that repo?

Thanks for any help!

aschneid
  • 11
  • 2
  • 2
    Sounds like you want to create a patch: http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specific-commit. – Felix Kling May 17 '13 at 16:49
  • @FelixKling certainly sounds that way. Thanks! – aschneid May 17 '13 at 17:10
  • Thanks @twalberg, but it looks like that will pull all source for a particular revision (or list of revisions). Some of our source repos are quite large, so we will only want deltas to go. I think the patch solution may more match what we are looking for. – aschneid May 17 '13 at 20:17

2 Answers2

2

Use git bundle, as twalberg suggests. You can bundle up a whole branch, branch-name, with:

git bundle create bundlefile branch-name

or just the deltas since the last-release-version tag:

git bundle create bundlefile-delta last-release-version..branch-name

Bundles can be more efficient than patches to transport and are simpler to apply:

git fetch bundlefile-delta branch-name:branch-name
Joe
  • 29,416
  • 12
  • 68
  • 88
1

One way to do this would be format-patch

$ git format-patch 8fbee89..master
0001-Remove-the-insane-fold-operation-replace-with-saner-.patch
0002-Make-array-construction-use-LOADVN-slightly-faster.patch
0003-EACH-need-not-make-a-backtrack-point-on-the-last-ite.patch

Contained in each file is the diff and great information like this

From bc42812715fb56e72717bf18809dd9ba59771b3a Mon Sep 17 00:00:00 2001
From: Stephen Dolan 
Date: Thu, 16 May 2013 15:07:53 +0100
Subject: [PATCH 1/3] Remove the insane "fold" operation, replace with saner

or if you are using GitHub it can make it for you!

github.com/stedolan/jq/compare/8fbee89...master.patch

Then take patch files to the "lockdown" area or whatever, and run

git am 0001-Remove-the-insane-fold-operation-replace-with-saner-.patch

and so on.

How do patches work in Git?

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407