Git: Difference between revisions
(→General GIT Workflow: check what you are going to push (not commit)) |
Jaustinpage (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Obsolete| This page describes git flows using email patch submissions, and should be updated with github based pull requests}} | |||
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 git.alpinelinux.org]. | 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 git.alpinelinux.org]. | ||
Revision as of 15:27, 13 October 2016
This material is obsolete ... This page describes git flows using email patch submissions, and should be updated with github based pull requests (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 git.alpinelinux.org.
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 user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com
Using git config without --global let you configure other details for a specific git repository.
git config --global color.ui true git config --global core.pager more
git config --global http.proxy http://proxy_ip:proxy_port
Cloning a repository via Git
There are two ways to work with the Alpine git repository...
- ...without write access.
- ...with write access.
git.alpinelinux.org 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://git.alpinelinux.org/aports.git
git clone http://git.alpinelinux.org/cgit/aports
If you want only the last 3 revisions:
git clone git://git.alpinelinux.org/aports.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 the URL needs to be adjusted for cloning a repository
git clone ssh://username@git.alpinelinux.org/aports.git
General GIT Workflow
- Make your file edits in your local checkout of the local copy of repository.
- Commit the changes in your local repository:
git commit
- Bring the rest of your local repository up to date:
git pull --rebase
- Check what you are going to push:
git log origin..master
- Move your changes up to the master if you have write access
git push
or create a patch if not.
Further reading
- Git Tutorial
- Git - SVN Crash Course (quickstart if you know svn)
- A tour of git: the basics Recommended
- The Git Community Book
- Git From the Bottom Up
- Very good Git guide