Development using git

From Alpine Linux
Jump to: navigation, search
This page is proposed for moving ...

It should be renamed to Git. All git development articles should be consolidated (Discuss)

This document describes how to use git for Alpine Linux development and related projects. If you just want to browse the Alpine git repositories, please visit

Basic Git usage

Configure your global git config

First you need to tell your name and email to git. This name and email will show up in all your commits.

git config --global "Your Name Comes Here" git config --global

Using git config without --global let you configure other details for a specific git repository.

Tip: If you want to use git with colored output use:

git config --global color.ui true git config --global core.pager more

Tip: If you want to use git with proxy server:

git config --global http.proxy http://proxy_ip:proxy_port

Email configuration

To be able send your commits (patches) via email you need configure an SMTP server.

git config --global sendemail.smtpserver

For sending from a gmail address you can do:

git config --global sendemail.smtpserver git config --global sendemail.smtpserverport 587 git config --global sendemail.smtpencryption tls git config --global sendemail.smtpuser

Optionally, it is possible to skip the password prompt by adding it to the configuration with:

git config --global sendemail.smtppass your_password

To reset CC mail attribute

git config --global sendemail.suppresscc all

Example ~/.gitconfig

        email =
        name = Your Name
        editor = nano
        pager = less -FXRS
        from = Your Name <>
        smtpuser =
	smtpserver =
	smtpencryption = tls
	smtpserverport = 587
	suppresscc = self

        default = simple

Cloning a repository via Git

There are two ways to work with the Alpine git repository...

  • ...without write access.
  • ...with write access. shows all available Alpine git repositories.

Without write access

If you want to clone the Alpine aports repository, switch to the directory you want to have the aports/ directory in and launch git.

git clone git://

Tip: If you are using proxy server:

git clone

If you want only the last 3 revisions:

git clone git:// --depth 3

Use the command below to see the full log of the trunk.

git log

With write access

If you have write access to the Alpine repository, the URL needs to be adjusted for cloning a repository

git clone

Alternatively you can set the remote url of an exisiting git clone:

git remote set-url origin

General GIT Workflow

  1. Make your file edits in your local checkout of the local copy of repository.
  2. Commit the changes in your local repository:

    git commit

  3. Bring the rest of your local repository up to date:

    git pull --rebase

  4. Check what you are going to push:

    git log origin..master

  5. Move your changes up to the master if you have write access

    git push

    or create a patch if not.

Other related articles

Further reading