Setup Your Development Environment¶
This guide sets you up a development workstation to contribute to Kolab Groupware development on Phabricator.
Install the Tools¶
Ensure you have our Tools repository configured.
# cd /etc/yum.repos.d/
For Fedora 23:
# wget https://obs.kolabsys.com/repositories/Tools/Fedora_23/Tools.repo
For Fedora 22:
# wget https://obs.kolabsys.com/repositories/Tools/Fedora_22/Tools.repo
For Red Hat Enterprise Linux 7:
# wget https://obs.kolabsys.com/repositories/Tools/RHEL_7/Tools.repo
Import the GPG public key the packages are signed with:
# rpm --import https://ssl.kolabsys.com/community.asc
Install arcanist:
For Fedora 22 and Fedora 23:
# dnf -y install arcanist
For Red Hat Enterprise Linux 7:
# yum -y install arcanist
Hook up arcanist to Phabricator:
# arc set-config default https://git.kolab.org/ # arc install-certificate
And follow the instructions.
Recommended Configuration¶
SSH Configuration
Configure SSH to use the correct username and SSH identity when you use
git.kolab.org
:$ grep -A3 git.kolab.org ~/.ssh/config Host git.kolab.org User git IdentityFile ~/.ssh/id_rsa
BASH Completion
Say something about bash completion and how great it is.
GIT Prompt
Say something about the git prompt.
GIT Configuration
For each repository separately, or otherwise globally:
$ git config [--global] user.name "Jeroen van Meeuwen (Kolab Systems)" $ git config [--global] user.email vanmeeuwen@kolabsys.com $ git config [--global] branch.autosetuprebase always $ git config [--global] push.default matching
~/.bashrc
A recommended snippet for ~/.bashrc to assist you visually:
export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWUNTRACKEDFILES=1 export GIT_PS1_SHOWUPSTREAM="auto verbose" if [ ! -f "/etc/bash_completion" ]; then if [ -f "/etc/bash_completion.d/git" ]; then cp /etc/bash_completion.d/git ~/.git-completion.sh . ~/.git-completion.sh PS1='[u@h W$(__git_ps1 " (%s)")]$ ' elif [ -f "/usr/share/bash-completion/completions/git" ]; then cp /usr/share/bash-completion/completions/git ~/.git-completion.sh . ~/.git-completion.sh PS1='[u@h W$(__git_ps1 " (%s)")]$ ' fi else PS1='[u@h W$(__git_ps1 " (%s)")]$ ' fi if [ -f "/usr/share/git-core/contrib/completion/git-prompt.sh" ]; then source /usr/share/git-core/contrib/completion/git-prompt.sh fi
This makes your shell navigating in to a GIT repository appear as follows:
cd in to a GIT repository:
[kanarip@dws06 ~]$ cd ~/devel/src/kolab/pykolab.git [kanarip@dws06 pykolab.git (master u=)]$
This means a clean working copy.
Create an untracked file:
[kanarip@dws06 pykolab.git (master u=)]$ touch something [kanarip@dws06 pykolab.git (master % u=)]$
THe % means untracked files exist in the directory hierarchy.
Add the untracked file:
[kanarip@dws06 pykolab.git (master % u=)]$ git add something [kanarip@dws06 pykolab.git (master + u=)]$
The + means tracked, uncommitted files exist in the directory hierarchy.
Change a file:
[kanarip@dws06 pykolab.git (master + u=)]$ echo 1 > something [kanarip@dws06 pykolab.git (master *+ u=)]$
The * means uncommitted changes to tracked files exist. The + still indicates a tracked file is not yet committed.
Checkout another branch. In this example, it is specifically made dirty to show off:
[kanarip@dws06 pykolab.git (master *+ u=)]$ git checkout pykolab-0.7 A something Switched to branch 'pykolab-0.7' Your branch and 'origin/pykolab-0.7' have diverged, and have 4 and 65 different commits each, respectively. (use "git pull" to merge the remote branch into yours) [kanarip@dws06 pykolab.git (pykolab-0.7 *+ u+4-65)]$
This means we have 4 commits to our local working copy not yet in the remote tracked, and 65 commits in the remote tracked not yet in our local working copy.
Attempt to rebase on top of the tracked remote:
[kanarip@dws06 pykolab.git (pykolab-0.7 *+ u+4-65)]$ git rebase origin/pykolab-0.7 --autostash Created autostash: 49f31f4 HEAD is now at a6fb106 Ensure docker runs on atomic hosts First, rewinding head to replay your work on top of it... Applied autostash. [kanarip@dws06 pykolab.git (pykolab-0.7 + u=)]$
You’ll notice the + again stands for the tracked, not yet committed file
something
.