全部博文(120)
分类: LINUX
2011-05-13 16:04:36
0. Before you do following steps, if you are not familiar with git, read these manuals first:
And do your experiments on test.git first:
git://srdclcs2/git/test.git
1. Clone the git from server. We’ll use the xhci.git for our development.
#git clone git://srdclcs2/git/xhci.git xhci-development
#cd xhci-development
2. vim .git/config, modify the url under remote “origin” as follows:
url = ssh://[username]@srdclcs2/srv/pub/xhci.git
3. Configure your user name with:
# git config --global user.name “First_name Last_name”
4. Configure your user email with:
# git config --global user.email email@amd.com
5. The xhci.git has several branches. You can check the branches by
#git branch -a
Now checkout srdc branch for development:
#git checkout -b srdc origin/srdc
We will use this branch to develop our driver.
6. Now modify code, compile, do smoke test; after smoke test passed, commit your change and format the patch. Do not forget the patch name and necessary descriptions.
#git commit -a
#git format-patch -s HEAD~1
HEAD~1 means the latest patch from HEAD. HEAD~2 means the latest two patches from HEAD.
# git format-patch
To get a single patch for a commit.
7. If you have already commit your changes and format the patch, but you want to change the commit – maybe you find some error, or somebody else give their suggestions in patch review, you can use git reset to cancel the commit and re-commit it when finished.
#git reset HEAD^
This command cancels your latest commit, but keeps your code change.
HEAD^ means the latest commit. HEAD^^ means the latest two commits.
#git reset --hard HEAD^
This command not only cancels your commit, but also removes your code changes in the commit.
When finished the change, follow step 6 to re-commit. It will replace your cancelled commit automatically.
8. Send out the patch to peer review; after review passed, push it to server:
#git push origin srdc:srdc
This will update the srdc branch on our git server with your own srdc branch. Please be careful with this command, do not push into the wrong branch.
And submit the patch to our svn server for backup:
Linux_Chipset_Drivers\trunk\Source\Linux\SB900\USB 3.0 development
9. After the push, send out an email to notice others your push. When others use this branch, their branch will be old and should use git pull to get the latest branch.
10. If you like, you can clone sarah’s xhci tree and check her updates:
#git remote add sarah git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git
#git checkout -b sarah-alt-settings sarah/xhci-alt-settings
11. Feel free to update this guide.
Git administration:
# ssh –l git srdclcs2
# cd /srv/pub/xhci.git
Virtualization Machine administration:
#virt-manager –c qemu+ssh://srdclcs1/system