Comparative publishing…
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.- First, on the server on which you want to serve from, install `git`.
- Next, on that server, `mkdir -p /where/to/serve/branch`
- …then `cd` into it and run `git init --bare`
- …followed by the highly obvious `chmod +x hooks/post-update` in order that the HTTP fetches work properly.
- Now, on your client, `git remote add website ssh://myserver/path/to/branch`
- …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)
- …and then `git push website master`. Later you can do `git push` if you did do the config command.
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.- 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).