This wiki is automatically published from ohmyzsh/wiki. To edit this page, go to ohmyzsh/wiki, make your changes and submit a Pull Request.

Oh My Zsh is a community-driven project and contributions are welcome, but it all works best with a proper setup. Here follow the best practices for setting up a fork and getting started for contributing.

Prerequisites

You will of course need Git and a UNIX terminal. You should be familiar with the basics of contributing on GitHub.

You will have to make a choice, whether you simply want to properly send PRs, or if you also wish to maintain your own fork (with your own changes) as a personal alternative version of OMZ. Think about it, it will come around later on.

The following section explains how to set up your local Oh My Zsh install with the proper remote repositories.

Setting up

From this point on, <name> stands for your GitHub username.

This supposes that you have Oh My Zsh installed already in $ZSH (default: ~/.oh-my-zsh) with the origin remote pointing to the original repository.

Simple contribution setup

All the following uses <name> for the remote name, but you can use something else.

cd $ZSH
git remote add <name> git@github.com:<name>/oh-my-zsh.git

Upgrading: as long as your local master branch cleanly follows origin/master (which still points to the original repository), auto-upgrade should work fine.

More setups: on a new machine, simply install OMZ as usual, do step 3, and of course copy your startup files; you will be able to get upgrades, and to work on your pending PRs.

Sending PRs

Maintained fork setup

cd $ZSH
git remote rename origin upstream
git remote add origin git@github.com:<name>/oh-my-zsh.git

Upgrading:

More setups: on a new machine, simply git clone git@github.com:<name>/oh-my-zsh.git ~/.oh-my-zsh and git remote add upstream git@github.com:ohmyzsh/ohmyzsh.git, and of course copy your startup files; you will be able to get upgrades, and to work on your pending PRs.

Sending PRs

Pull Requests

These are technical instructions, please read the contributing guidelines (project) before sending PRs.

The following uses my-new-pr for the branch name, but you can use something else.

Simple contribution PRs

git checkout origin/master
git checkout -b my-new-pr

You are now on your dedicated PR branch. Time to commit some changes!

git push <name> my-new-pr

You can now go to GitHub and create the PR.

Updating: in case there are conflicting changes upstream after you created the branch, you will have to git pull --rebase origin master on my-new-pr branch and resolve conflicts, and then git push --force <name> my-new-pr, in order to keep your PR up to date.

More setups: on another machine, simply git checkout <name>/my-new-pr and git checkout -b my-new-pr to continue working on a pending PR.

Maintained fork PRs

git checkout upstream/master
git checkout -b my-new-pr

You are now on your dedicated PR branch. Time to commit some changes!

git push origin my-new-pr

You can now go to GitHub and create the PR.

Updating: in case there are conflicting changes upstream after you created the branch, you will have to git pull --rebase upstream master on my-new-pr branch and resolve conflicts, and then git push --force origin my-new-pr, in order to keep your PR up to date.

More setups: on another machine, simply git checkout origin/my-new-pr and git checkout -b my-new-pr to continue working on a pending PR.