Using Git

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 8. almost 2 years by david.bernard.31
  2. 7. almost 2 years by david.bernard.31
  3. 6. almost 2 years by david.bernard.31
  4. 5. almost 2 years by david.bernard.31
  5. 4. almost 2 years by david.bernard.31
  6. 3. almost 2 years by mgn
  7. 2. almost 2 years by david.bernard.31
  8. 1. about 2 years by d6y
 

Links


 

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 email
git 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