worg-git.org 3.7 KB

What is git?

git is a fast version control system that let you collaborate on a project. For details on how using 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 Worg repository page is here: http://repo.or.cz/w/Worg.git

The first time you contribute to Worg

  1. Register a new account on the git public repository (where worg
  2. lives): http://repo.or.cz/m/reguser.cgi -- see the tutorial on how to [[file:worg-git-ssh-key.org][create a SSH-key for repo.or.cz]].
  1. Drop me an email (bzg AT altern DOT org) and ask me to be listed as
  2. an Org contributor, telling me your username on the git repository;
  1. Install git on your system.
  1. Clone the project somewhere in a working directory:

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

  1. Go to the newly created Worg/ directory and edit the files
  1. Add new files to the index:

:~$ git add *.org

  1. Get a diff a the change you've just made:

:~$ git diff --cached

  1. Commit changes with the appropriate ChangeLog:

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

  1. Push your change to Worg:

:~$ git push

Editing Worg from an existing working directory

  1. Update your Worg directory:

:~$ git pull

Note: this is the equivalent of cvs update and will complain if there are conflicts between your working directory and the remote Worg directory.

  1. Edit the files
  1. Add new files (git-add) and commit your changes (git-commit)
  1. Push your Worg directory

:~$ git push

You're done!

Anonymous editing through the "mob" user/branch

If you don't want to register a new account on repo.or.gz but still want to suggest modifications on Worg, you can do this by editing the "mob" branch of Worg. For details about the mob user, check this webpage on repo.or.cz

This branch is usually empty, since interesting changes are quickly merged into the master branch. But it is important to make sure that you pull all changes in any existing mob branch before trying to push yours.

  1. Clone the Worg project as the mob user:

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

  1. Check out the "mob" branch to avoid conflicts between the mob
  2. branch that you will soon create and any existing =mob= branch:

:~$ git checkout origin/mob

You should get this warning:

Note: moving to "origin/mob" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
now or later) by using -b with the checkout command again. Example:
git checkout -b 

Don't worry.

  1. Create a new branch named mob from this checkout:

:~$ git checkout -b mob

  1. Edit the files, add new files (git-add) and commit (git-commit)
  2. them as usual.
  1. Push the mob branch into the Worg remote directory:

:~$ git push origin mob

You're done!