These are notes on using git to do k42 development.
Getting your own copy of the git tree for development
This will make a local copy of the main k42 git repo.
git-clone http://www.cs.unm.edu/~k42/git/kitchsrc.git && cd kitchsrc && git-checkout k42-port && cd ../
This will make a local copy of repo for the linux tree used by k42
git-clone http://www.cs.unm.edu/~k42/git/linux-030.git && cd linux-030 && git-checkout k42-port && cd ../
The git-checkout command in the above code will switch you to the branch currently being used for development.
Updating your tree
This will pull any change to the main k42 tree into your current branch, and merge them in. This is roughly equilvalent to doing a svn update.
cd kitchsrc && git-pull http://www.cs.unm.edu/~k42/git/kitchsrc.git k42-port && cd ../
Applying a Patch
git-apply --index <patch file>
General Workflow
Create a new branch (in this case, we assuming you want to start with k42-port tree).
cd kitchsrc git-branch my_new_branch k42-port ~write code that breaks things~ git-commit -a
Merging between branches.
cd kitchsrc git-pull . k42-port
This will pull any changes from k42-port into your current branch, and merge them, and commit the merged version. If there's a conflict, well….
Regressing. Say you screwed up on file 'foo' and you want to regress to the last version you commited. Note this will, remove any changes to your workspace.
cd kitchsrc> rm foo git-checkout -f <current-branch name>
(Note this may not be the “proper” git way of doing this, but it works)
Pull Changes from another, remote branch
First make sure that all changes to your current branch are committed, because this will remove them.
- switch to the branch which has changes you want.
git-checkout mybranch
- pull changes for that branch
git-pull mybranch
- switch back to the branch you want updated
git-checkout my_other_branch
- pull those changes
git-checkout . mybranch
- Fix any conflicts by editing the files
- Commit fixed conflicts
git-commit -a