How to use git to edit Worg files?

{Back to Worg's index}

Table of Contents

What is git?

git is a fast version control system that lets you collaborate on a project. For details on how to use git, go and read the git tutorial. For details on the public git repository, go and read the about page of http://repo.or.cz/.

The homepage of the Worg project is here: http://repo.or.cz/w/Worg.git

The first time you contribute to Worg

  1. If you don't have a SSH-key, create one.
  2. Register a new account on the git public repository.
  3. Drop an email to Bastien mentioning your username on repo.or.cz
  4. Install git on your system.
  5. Clone the project somewhere in a working directory:

    ~$ git clone git+ssh://repo.or.cz/srv/git/Worg.git
    

  6. Go to the newly created Worg/ directory and edit some files.
  7. If you created files, add them to the git index:

    ~$ git add *.org
    

  8. Commit changes with the appropriate ChangeLog:

    ~$ git commit -a -m "My changelog"
    

  9. Push your change to Worg:

    ~$ git push
    

    This stage didn't work for me, instead I had to add a remote like so:

    ~$ git remote add public git+ssh://<UserName>@repo.or.cz/srv/git/Worg.git
    

    Where <UserName> is the username you supplied repo.or.cz. Then do a:

    ~$ git push public
    

How Worg publishes itself as HTML?

The server behind http://orgmode.org website takes care of publishing Worg into HTML. This is done in two steps: the first step is to pull the Worg directly on the server, the second one is to publish the last version of Worg on the website. Both steps are cron'ed every hour, the first one at 1:00, 2:00, etc. and the second one at 1:30, 2:30.

So for example, if you push a change in Worg at 0:58am, this will be pulled on the server at 1am and will appear on the website at 1:30am.

The second time you contribute to Worg

  1. Go to your Worg/ directory.
  2. Be sure to "pull" the last version of the repository.
  3. Make some changes.
  4. Commit your changes on your local repository:

    ~$ git commit -a -m "My ChangeLog"
    

  5. Push your change on the remote repository

    ~$ git push
    

Getting organized

The Worg TODO file is worg-todo.org. If you are a Worg zealot, maybe you want to add this file to the list of your agenda files. For example, here is my org-agenda-files variable:

(setq org-agenda-files '("~/org/bzg.org" "~/git/Worg/worg-todo.org")

I have an agenda custom command for checking tasks that are assigned to me:

(org-add-agenda-custom-command '("W" tags "Owner=\"Bastien\""))

The next time someone assigns a task for me, it will appear in my Worg agenda view.

Register your changes under your name

Information regarding your name is stored in the .gitconfig file, where you pulled the Worg project.

Edit it like this:

[user]
        name = Your Name Goes Here
        email = you@yourdomain.example.com

Now your changes will be filed under your name.

Alternatively you can add this to ~/.gitconfig which will apply to all git repositories you have.