KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents
Revision 1 as of 2006-08-14 03:57:02
KernelNewbies:
  • GitTips

Git Tips and Tricks

At first Git might present a very different picture to a newbie, espcially if he/she has used other Source Code Management tools like Subversion or CVS. Most striking differnce is that there is no central repository for Git to operate. The repository is the .git directory created on a working tree.

This presented considerable confusion to me when I tried to learn Git. Finally I stumbled across the idea and took time to digest. There are pages explains how to make git emulate the central repository model. I have never used it and now I am much more comfortable with Git's model than central repository model.

Later when I started cloning (git-clone) and pulling (git-pull) from Linus' tree, I faced a very interesting problem. I created a branch by name experimental using the command,

$ git-branch experimental

I make my own modifications to this branch. At the same time, linux kernel goes forward by adding many patches. So I needed to pull the latest branch. But I did not switch to master branch by doing

$ git-checkout master

As a result, always my experiemental tree was merged, and not my master. So whenever I try to generate a patch by

$ git-diff  --patch-with-stat master experimental

I used to get all the differences applied to the main tree as well as the local patches I applied. So take care to do the git-checkout of the branch you wish to merge to.

Sometimes you may find git doing a diff of a number of files using the command diff --git a/path/to/file b/patch/to/file The reason is that git thinks there is a difference between them because of the time stamp stored and the time stamp of the file is different. So either do

$ git-status

or

$  git-update-index --refresh

This would get rid of the diff --git .... messages.


CategoryKernelHacking

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01