Contents
- Git guide for Linux wireless users and developers
- Cloning wireless-2.6
- Checking out the ''everything'' branch
- Get the latest updates
- Review the changes last registered
- To review changes made to wireless drivers
- Hacking on Linux wireless
- Check available branches
- Reviewing changes between commmits
- Merging git branches
- Checkout code as it was from specific commit
- Delete branches
Git guide for Linux wireless users and developers
This is a quick git-guide for Linux users and developers. The latest development takes place on John Linville's wireless-2.6 git tree. Some of the latest work is on a branch called 'everything'.
Cloning wireless-2.6
First, clone the wireless-2.6.git tree
git-clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git cd wireless-2.6
Checking out the ''everything'' branch
Since the latest work is on the 'everything' branch, lets check that out, and lets keep track of changes for it, so we can later simply 'pull' changes from this branch.
# Create a local "branch" called 'everything' based on John's remote 'origin/everything' # We are going to add --track so we can git-pull from the branch git-checkout --track -b everything origin/everything
Get the latest updates
You will want to update your local git repository to match what John has last committed. You can do this as follows.
git-pull
Review the changes last registered
git-log
To review changes made to wireless drivers
git-log -p drivers/net/wireless/
Hacking on Linux wireless
If you'd like to hack on Linux wireless you can create own branch based on the one you are using. This is so you don't screw your current branch up.
git-checkout -b my-fix-for-foo origin/everything # hack hack hack # To get a diff of your work: git-diff > my_changes.diff # Or if you just want to read them: git-diff # To revert to the original state of the branch: git-checkout -f # If instead you want to commit git-commit -a
Check available branches
Suppose you have created a few branches, and just are not sure what you have anymore.
# To view local branches git-branch -l # To view all remote branches git-branch -r
Reviewing changes between commmits
Suppose you want to get the log and diff between two commits.
# get the SHA of two commits git-log # Then get the diff of them, by showing the logs in between git-log -p d8a285c8f83f728be2d056e6d4b0909972789d51..9202ec15da36ca060722c363575e0e390d85fb71 # Since SHAs are pretty unique you can just give it a short version # and it will try to match what is right: git-log -p d8a28..9202e
Merging git branches
Say you have two local branches, and I want to merge them. If you're on local branch my-latest and I want to merge with local branch my-fix-for-foo, you would do:
git-pull . my-fix-for-foo
Checkout code as it was from specific commit
Suppose you want to checkout what the codebase looked like at a specific commit SHA. You can do this with branches.
# Long form: git-checkout -b view-commit-foo d8a285c8f83f728be2d056e6d4b0909972789d51 # Or short form: git-checkout -b view-commit-foo d8a28
Delete branches
If you are fed up with a branch delete it. You must not be on that branch so go into another one.
git-checkout master git-branch -D old-branch