Git 101 (for libvpx)

Create An Account

Browse to http://gerrit.chromium.org/ and complete the registration process. You must register using OpenId. OpenId provides secure single-sign-on, so you don’t need to create a new account or remember another password. If you have a Google account or a Yahoo ID, you’re all set. There are many other OpenID providers available. You may already have an OpenID. OpenID does not reveal your passwords to us.

Contributor Agreement

You will be required to execute a contributor agreement to ensure that the WebM Project has the right to distribute your changes. Individuals can execute the agreement online. Corporations must submit the agreement via mail or fax.

Create or Upload your SSH Public Key

You must have an SSH public key to upload changes to Gerrit. GitHub has some good guides to creating these keys if you haven’t done this before. This is just a guide — you don’t have to sign up for GitHub to contribute to WebM.

Set-up Your Local Repository

Look-up the URL for the project you’d like to work on, listed under pull on our Code page. The URL uses the git:// protocol.

To clone the project repository on your local machine, give a command similar to the following:

$ git clone http://git.chromium.org/webm/libvpx.git ~/working

The above creates a clone of the repo at ~/working/libvpx.

commit-msg Hook

Gerrit requires that each submission include a unique Change-Id. You can assign one manually using git commit --amend, but it’s easier to automate it with the commit-msg hook provided by Gerrit.

Copy commit-msg to the .git/config directory of your local repo. Example:

$ scp -p -P 29418 xxx@gerrit.chromium.org:hooks/commit-msg .git/hooks/
or
curl -o .git/hooks/commit-msg https://gerrit.chromium.org/gerrit/tools/hooks/commit-msg

sudo chmod 755 commit-msg

See the Gerrit documentation for more information.

better git checkout -b mychange origin/master

Upload Your Change

Find the correct URL to push to on the main code page and determine the branch you want your change to start on by looking at our repository layout. You can set up your Git and SSH configurations to simplify this command line quite a bit. See the Gerrit documentation for more information. The command you’ll use is of the general form:

$ git push ssh://xxx@gerrit.chromium.org:29418/webm/projectname HEAD:refs/for/branchname(master)

 

 

posted @ 2013-04-26 21:23  Chjun  阅读(441)  评论(0编辑  收藏  举报