Version 8, last updated by David Bernard at Dec 15 09:37 2011 UTC
Links
- Git instructions from assembla
- Man Page
- a simple git reference
- Pro Git book
- Learn git one commit at a time : a cookbook for git users
- Git for beginners: The definitive practical guide from StackOverflow
Some actions/tips
Daily development inside a local git branch
First, create a new branch for the development you're working on. e.g.
git checkout -b plugin-interpreter-overhaul
Make a few changes locally and perform a local commits, e.g.
touch README-INTERPRETER git add README-INTERPRETER git commit -m "Added readme for interpreter
This commit is completely local to your machine, and will not be reflected in the subverison repository. This is a handy way to keep track of your own progress in development, while not requiring "completely finished and stable" commits. When you get your branch to a "completely finished and stable" state, you can then either generate a patch for submission, or commit directly.
Switching branches
When desired, you may switch local branches using the checkout command, e.g.
git checkout <branchname>
Reverting local changes
If desired to revert your local changes, simply run:
git checkout -f
Reverting to trunk
git reset --hard HEAD
Merging commits across branches
To pull commits from one branch into another (or to/from master), use the merge command, e.g.
git merge <other-branch>
This section needs fleshing out. Anyone with more extensive git knowledge, please help explain things better.
Creating a patch for submission
git tag last-send
# hack, commit, hack, commit
git format-patch -M -C last-send..
# mail *.patch or attach *.patch to a ticket
rm *.patch
git tag -f last-send
Only committed changes will be part of the patch
Applying a patch from submission
if patch file start as an emailgit am xxxx.path
if it's a "regular" patch (generated via diff or git diff)
git apply xxxx.path
Working on remote branch (eg wip_featureX)
git clone git@git.assembla.com:scala-ide.git # if you get 'Permission denied' errors, try instead: # git clone git://git.assembla.com/scala-ide.git cd scala-ide git checkout -b wip_featureX origin/wip_featureX
instruction "git checkout wip_featureX" create a new local branch off master, not attached to the remote origin/tycho-reorg branch.
git branch # check wip_featureX is selected
# do modification cd org.scala-ide.build ./build-ide-release.sh cd -
git commit
# to create a patch git format-patch
# or to push git push origin wip_featureX