Maximilian Attems: Particle Physics Planet

echo $FIRST_SHA >> .git/info/graft git filter-branch -fThen with interactive git rebase you can rewrite this important initial commit. Of course you have to define $FIRST_SHA and your repo shouldn't be dirty.
deb http://kernel-archive.buildserver.net/debian-kernel trunk mainThis is not yet the real Etch + 1/2 kernel, but comes pretty close. According to our initial testing and user feedback 2.6.24 promises to be a great release. It will help Etch to have proper hardware support for newer hardware, has better power efficiency due to tickless kernel, enhanced wireless card support, the CFS scheduler and much more... It is a Debian novelty to provide an supported optional Linux kernel upgrade for a stable release. This is not the final as due to incompatible user interface the Etch build will have the old firewire stack. Once aboves land in Sid and got broader coverage will announce the Etch snapshots. So please give it a shot on your Testing/Unstable boxes.
aptitude install \ git-buildpackage git-core git-cvs git-daemon-run \ git-doc git-email git-gui git-load-dirs git-svn \ gitk gitweb qgitNow let’s start with some general and basic configuration:
# Remove directories from the SVN tree if there # are no files left behind, configure it globaly: git config --global svn.rmdir=true # Want some more global, personal git configuration? for line in user.name=Michael Prokop user.email=foo@example.invalid color.diff=auto color.diff.new=cyan color.diff.old=magenta color.diff.frag=yellow color.diff.meta=green color.diff.commit=normal do git config --global $line doneCheck out man git-config for much more details about configuration options. First tip: set ‘g’ as an alias for git so you don’t have to type that much. I’ll write the long version in the following examples so copy/paste works for everyone. Make sure to use the short options of git itself as well: use ‘git co’ for example instead of ‘git checkout’. You can define your own aliases inside git as well - either manually in ~/.gitconfig or running something like:
git config --global alias.st statusEnough pre-configuration for now. It’s time to checkout the SVN repository:
# Check out the SVN repository and set 'svn/' as # prefix for the branches: git svn clone -s --prefix=svn/ \ https://svn.tugraz.at/svn/$project foobar && cd foobar # Adjust svn:ignore settings within git: git svn show-ignore >> .git/info/exclude # List all branches: git branch -a # List all remote branches: git branch -r # Rebase your local changes against the # latest changes in SVN (kind of 'svn up'): git svn rebase # Checkout a specific branch: git checkout $branchOk so far? But what do we have to do if we want to work on the upstream source and are allowed to commit/push directly to the repository? Let’s see how to work on that without using branches:
# Hack: $EDITOR foobar # Check status git st[atus] # List diff: git diff [foobar] # Commit it with a commit message using $EDITOR: git commit -a # Now commit your changes (that were committed # previously using git) to SVN, as well as # automatically updating your working HEAD: git svn dcommitBut what should we do if we do not have commit rights? Let’s create our own branch and send a patch via mail to upstream:
# Make a new branch: git checkout -b mikas_demo_patch # and hack... $EDITOR # Commit all changes: git ci -a -m 'Best patch but worst commit msg ever' # ... and prepare patch[es]: git format-patch -s -p -n master # Now send mail(s) either use git-send-email: git send-email --to foo@example.invalid *.patch # ... or if you prefer mutt instead (short zsh syntax): for f in *.patch ; mutt -H $fYou got a mail from someone else and would like to incorporate changes from the attached patch in your repository? Just store the mail in a seperate mailbox (use save-message in mutt for example, keybinding ’s’ by default), then execute:
# Apply a [series of] patch[es] from a mailbox git am /path/to/mailboxWant to work on a seperate branch and rebase your work with upstream?
# First of all make sure to use recent sources... # So pull when using plain git: git pull -u # .. or when using git-svn use: git svn rebase # Then create a new branch: git checkout -b mika # Hack: $EDITOR # Commit: git ci -a -m 'Best patch but worst commit msg ever' # Switch to master branch: git checkout master # Pull again when using plain git: git pull -u # .. or when using git-svn use: git svn rebase # Finally switch back git checkout mika # Now rebase it with plain git using: git rebase origin/master # ... or when using git-svn: git svn rebase # Now check out the last 5 commits: git log -n5Another branch-session might look like:
git co -b foo $EDITOR git ci -a -m 'foo changes' git co master git co -b bar $EDITOR git ci -a -m 'bar changes'' git co foo git rebase bar git log -n5 git st git branchPfuhhh? Right.
git stash git pull / fetch+rebase $EDITOR # fix conflicts git commit -a -m "Fix in a hurry" git stash apply git stash clear # unless you want to keep the stashgit reset rocks as well:
# List all recent actions: git reflog # Now undo the last action: git reset --hard HEAD@ 0How to get rid of branches?
# Delete a branch. The branch must be fully merged: git branch -d remove_me_branch # Delete a branch irrespective of its index status: git branch -D remove_me_branch # Delete a remote branch: git push reponame :branchRepack a git repository to minimize its disk usage:
git pack-refs --prune git reflog expire --all git repack -a -d -f -l git prune git rerere gcUse git cherry to find commits not merged upstream. Another really cool feature is the interactive rebasing: git rebase –interactive Make sure you are aware of gitk:
[ -r ~/.gitk ] cat > ~/.gitk << EOF set mainfont Arial 10 set textfont Courier 10 set uifont Arial 10 bold EOFIf you prefer a Qt based interface check out qgit. Useful ressources:
usb 2-2: new full speed USB device using uhci_hcd and address 8 usb 2-2: configuration #1 chosen from 1 choice option 2-2:1.0: GSM modem (1-port) converter detected usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0 option 2-2:1.1: GSM modem (1-port) converter detected usb 2-2: GSM modem (1-port) converter now attached to ttyUSB1For lazy guys wvdial drei the wvdial.conf for 3 connectivity (hint - fix pin):
[Dialer drei] Modem = /dev/ttyUSB0 SetVolume = 0 Dial Command = ATDT Init1 = ATZ ;Init2 = AT+CPIN=1234 Init3 = ATE1V1&D2&C1S0=0+IFC=2,2 Init4 = AT+IPR=115200 Init5 = ATE1 Phone = *99# Stupid Mode = 1 Init8 = AT+CGDCONT=1,"IP","drei.at","0.0.0.0",0,0 Dial Attempts = 2 Username = xx Password = xxCurrent mood very happy. :) Aboves means connectivity almost everywhere in Austria due to A1 network fallback.
Next.