Difference between revisions of "Development using git"
m (→General GIT Workflow)
|Line 1:||Line 1:|
This document describes how to use [http://git-scm.com git] for Alpine Linux development and related projects. If you just want to browse the Alpine git repositories, please visit [http://git.alpinelinux.org/cgit/aports
This document describes how to use [http://git-scm.com git] for Alpine Linux development and related projects. If you just want to browse the Alpine git repositories, please visit [http://git.alpinelinux.org/cgit/aports ].
== Basic Git usage ==
== Basic Git usage ==
Revision as of 17:34, 4 July 2011
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.
Using git config without --global let you configure other details for a specific git repository.
To be able send your commits (patches) via email you need configure an SMTP server.
For sending from a gmail address you can do:
Optionally, it is possible to skip the password prompt by adding it to the configuration with:
To reset CC mail attribute
[user] email = firstname.lastname@example.org name = Your Name [core] editor = nano pager = less -FXRS [sendemail] from = Your Name <email@example.com> smtpuser = firstname.lastname@example.org smtpserver = smtp.googlemail.com smtpencryption = tls smtpserverport = 587 suppresscc = self [push] default = simple
Cloning the repository via Git
There are two ways to work with the Alpine git repository...
- ...without write access.
- ...with write access.
Without write access
cgit shows all available Alpine git repositories. If you want to clone the Alpine aports repository, switch to the directory you want to have the aports/ directory in and launch git.
If you want only the last 3 revisions:
Use the command below to see the full log of the trunk.
With write access
If you have write access to the Alpine the URL needs to be adjusted for cloning a repository
General GIT Workflow
- Make your file edits in your local checkout of the local copy of repository.
- Commit the changes in your local repository:
- Bring the rest of your local repository up to date:
- Check what you are going to commit:
- Move your changes up to the master if you have write access create a patch if not. or
Git Push (Distributed Workflows)
If working with Distributed Workflows you would 'pull' from public repo, 'push' to another publically accessable repo (where you have write access), main developer (who has write access to public repo) 'pulls' you changes from your pub.accessed.repo into the public repo.
To make it easier for you to work, you can configure 'git push' to push your work to your publically accessable repo ('git pull' would still pull from same repo as you cloned from).
Now 'git pull' pulls the public repo, and 'git push' pushes to your public repo.