So that I don’t lose all this knowledge the moment something more relevant to my life, such as breathing, occurs; I will dump it here for all to marvel at the incredible complexity of something which claims its strength lies in its simplicity.

Goal
To publish a git branch on a colo box such that someone else can get a copy of it to look at, and so that I can push my changes there and they can update their copy easily.
Complicating factor
My friend can only use HTTP to get at the branch due to proxy issues.

Case study one; Git:

Now, I’m not claiming this is the best way to do this; nor that it is the simplest way. This is simply the result of asking the question to extant git users.

  1. First, on the server on which you want to serve from, install `git`.
  2. Next, on that server, `mkdir -p /where/to/serve/branch`
  3. …then `cd` into it and run `git init --bare`
  4. …followed by the highly obvious `chmod +x hooks/post-update` in order that the HTTP fetches work properly.
  5. Now, on your client, `git remote add website ssh://myserver/path/to/branch`
  6. …and then if you want `git push` to do-the-right-thing, try `git config branch.branchname.remote website` (where `branchname` is the name of your branch, typically `master` for me)
  7. …and then `git push website master`. Later you can do `git push` if you did do the config command.

Your friend can now do git clone http://myserver/uri/to/branch and rejoice in the clone of your branch.

Case study two; Bazaar:

Again, I’m not claiming this is the best way; just the way I happen to know, having been a bzr user for a long time.

  1. On your client, `bzr push --remember sftp://myserver/path/to/branch` (you can drop the `--remember` if you don’t want it to be the default for the next `bzr push` you do).

Your friend can now do bzr branch http://myserver/uri/to/branch and rejoice in the branch of your branch.

Comments on this page are closed.