Chinaunix首页 | 论坛 | 博客
  • 博客访问: 407161
  • 博文数量: 120
  • 博客积分: 3125
  • 博客等级: 中校
  • 技术积分: 1100
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-29 10:59
文章分类

全部博文(120)

文章存档

2012年(28)

2011年(22)

2010年(34)

2009年(1)

2008年(35)

我的朋友

分类: 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 -1

                        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

阅读(666) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~