[pacman-dev] Git cheat-sheet for pacman - Was: [PATCH] links problem in bacman
Allan McRae
allan at archlinux.org
Sun Jun 22 23:46:27 EDT 2008
Carlo Bersani wrote:
>
> Sorry, I had to study how git works with coming exams
> Hope this is fine:
>
Here is the cheat-sheet I made when first starting pacman development.
It should be all you need to know for everyday git usage with the pacman
repo.
# Clone git repo - only needed once
git clone git://projects.archlinux.org/pacman.git pacman
# Enable useful hooks
chmod +x .git/hooks/{applypatch-msg,commit-msg,pre-commit,pre-rebase}
# Create branch "<branch>"
git branch <branch>
# Work with branch "<branch>"
git checkout <branch>
# Commit changes on current branch and make patch to master branch
git commit -a -s
git format-patch master
# Amend patch
git commit -a --amend -s
# Add file "<file>"
git add <file>
# Remove file "<file>"
git rm <file>
# Remove branch "<branch>"
git branch -D <branch>
# Update master branch
git checkout master
git pull
# Megre changes on master with "<branch>"
git-rebase master <branch>
# Get maint branch
git branch -r
git checkout -b maint origin/maint
More information about the pacman-dev
mailing list