set up a wiki (or a blog) using ikiwiki and gitosis
Create your ikiwiki wiki as usual, in the machine which will store the main (gitosis) repo. You'll end up with a bare repo (
wiki.git
), a normal repo (wiki
) and an ikiwiki setup file (wiki.setup
).Create the repo on the server side (gitosis). Add the repo name to the
gitosis.conf
file. Save, commit, and push the change.Move the bare repo to the folder where all gitosis folders are kept. Change the owner to the
gitosis
user.Move the normal repo to wherever you want to keep it.
Inside the normal repo, edit the
.git/config
file and change theorigin
url to the new filesystem location of the bare repo. (Usually something like/home/gitosis/repositories/your-git.git
).Edit the location of the
git_wrapper
script in thewiki.setup
file, to the new location of the bare repo. Check also thesrcdir
anddestdir
config. values.Change the owner of both the normal repo (
wiki
) and the HTMLdestdir
(~/public_html/wiki
, usually), to thegitosis
user.Run the command
ikiwiki --setup wiki.setup
That's all (IIRC)
git log
see all the commits to a file starting from the head of a given branch
git log <branch> -- <file>
change/undo a commit
This is only recommended when you have not made public the commits you want to change/delete
Say you are in the branch master, which tracks remotes/origin/master, and you want to make some changes to a commit in master which isn't yet in the corresponding remote. Do this
git rebase -i -- remotes/origin/master
git will open an editor, with a list of the not-yet-pushed commits. Change the
pick
in the commit you want for a edit
, write and close the editor.
git will leave your tree right in top of the offending commit. Do the changes you need to do, add them to the index, and do a
git commit --amend
to merge the added changes with the current commit. Once you do that, finish the rebase operation with
git rebase --continue
gitosis
Create a new repository
- Add the repo in gitosis.conf (in the
writable
section of some group). Commit and push. Create a local repo in another machine (let's call it
devbox
)# These two steps are not needed if you already have the git repo # (like when migrating one) git init # do at least one commit git remote add origin gitosis@git.devnull.li:YOUR_REPO_NAME.git git push origin master:refs/heads/master
ssh to
git.devnull.li
, edit/var/cache/git/pl.txt
, add a line with the name of the repo:YOUR_REPO_NAME.git
in
devbox
, in your repo, execute the two following commandsgit config branch.master.remote origin git config branch.master.merge refs/heads/master
export a git repository to subversion
We'll cover only exporting a git repo created via git-svn.
Create an empty svn repo. We'll call it svn-repo.
svnadmin create svn-repo
Make a dummy commit on it, using
svn
.- Clone the new repository using
git svn clone
. Find the commits numbers of:
- The first (and only) commit of the new svn repo.
- The first commit of the git repo you want to migrate.
Create a file
.git/info/grafts