aschneid
aschneid

Reputation: 11

Export git changesets to a closed environment repo

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!

Upvotes: 1

Views: 1149

Answers (2)

Joe
Joe

Reputation: 31087

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

Upvotes: 2

Zombo
Zombo

Reputation: 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?

Upvotes: 1

Related Questions