Configuring a Remote Repository

The ./bin/ directory of the source code contains a post-update script. Either copy this script to ./.git/hooks/post-update or link it with a symbolic link. To activate the hook, make it executable.

When a remote user pushes changes to the repository with git-push, the post-update hook will run and rebuild any changed files using the makefile. You may need to modify the makefile to specify a different location for the Pandoc or Markdown executables. This hook fundamentally updates the working copy and runs make to rebuild any changed Markdown files.

The working branch of the remote repository should not be updated locally, otherwise updates are likely to cause conflicts. Changes made locally are lost when a git reset --hard is used.

If the local checked out repository misbehaves:

  1. Make a backup of the repository
  2. git reset --hard HEAD
  3. make clean
  4. make

If you want to be sure things are really clean in step 3:

This will show all files that a git-clean will delete:

$ git clean -dxn

This will delete all those files:

$ git clean -dxf

Push Fails

If you get an error message similar to the following:

    remote: error: refusing to update checked out branch: refs/heads/master
    remote: error: By default, updating the current branch in a non-bare repository
    remote: error: is denied, because it will make the index and work tree inconsistent
    remote: error: with what you pushed, and will require 'git reset --hard' to match
    remote: error: the work tree to HEAD.
    remote: error: 
    remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
    remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
    remote: error: its current branch; however, this is not recommended unless you
    remote: error: arranged to update its work tree to match what you pushed in some
    remote: error: other way.
    remote: error: 
    remote: error: To squelch this message and still keep the default behaviour, set
    remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.

Run the following command in the target repository:

    $ git config receive.denyCurrentBranch ignore

References

Related Topics: AboutViki, CreatingABlankWiki

-- Frank Dean - 08 Feb 2010