[AT&T Samsung Galaxy S II Skyrocket SGH-I727] m4570d0n:
You weren't aware of this?

You don't have to cd into a project directory to do a repo sync for that project. You can just run repo sync path/to/project. from the root of your build tree.

While I'm here, someone asked me about some git stuff recently, and I figured the info might be useful here as well....

Start with the tutorials on github.

Create A Repo

Fork A Repo

Using Pull Requests

Github Glossary

Also, don't underestimate the usefulness of --help. It's nearly a universal rule that adding "--help" to any command will bring up a help menu for that command. For git, it's particularly helpful for me, and literally every git command has it's own help file, and usually has example commands as well. For example, each of these will bring up a different help file:

git branch --help
git pull --help
git log --help
git remote --help
git show --help

etc., etc.

You can also just browse the whole manual, which is where those help files come from.:

http://git-scm.com/docs

I've also had a few specific things I was trying to figure out how to do on git and in the process found some nice sites/articles that were very helpful:

Visual Git Cheat Sheet

git howto: revert a commit already pushed to a remote repository - Christoph Rüegg

On undoing, fixing, or removing commits in git

More reference info with examples:

http://gitref.org/branching/

http://gitref.org/remotes/

a few miscellaneous command I picked up that I found useful.

commit a change created by someone else, and manually retaining the original author of the commit:

git commit --author="John Doe <john.doe@gmail.com>"

commit a change created by someone else, and manually retaining the original author and the original commit date:

git commit --author="John Doe <john.doe@gmail.com>" --date="Thu Oct 03 20:19:03 2013 +0000"

Push a change to CM's gerrit or PAC-man's gerrit:

git push ssh://m4570d0n@review.cyanogenmod.org:29418/android_packages_apps_Setting HEAD:refs/for/cm-10.2

git push ssh://m4570d0n@review.pac-rom.com:29418/android_packages_apps_Settings HEAD:refs/for/cm-10.2

Find the git index blob associated with a particular file:

[COLOR=SeaGreen]m4570d0n@LenovoY580[/COLOR]:[COLOR=RoyalBlue]~/PAC[/COLOR]$ cd frameworks/base
[COLOR=SeaGreen]m4570d0n@LenovoY580[/COLOR]:[COLOR=RoyalBlue]~/PAC/frameworks/base[/COLOR]$ git hash-object core/res/assets/images/android-logo-mask.png
498ad8885e2a1e55a499c404effa457de2cb6461

Also there's a couple extra git packages in the official Ubuntu repos that can be pretty handy. One is called git-stuff. I'm pretty sure the guy that created that is one of the dudes in CM (author is Daniel Baumann and I see commits on CM's gerrit almost daily from a guy named Danny Baumann).

Two others:

git-extras

git-gui

git gui is kinda cool and noob friendly. In order to use it, just cd into a folder that has a git repo in it and type:

git gui

Another useful git command is git stash.

Let's say you made some local changes to /packages/apps/Mms. If you wanted to cherry-pick a commit that involved any files you changed locally, the cherry-pick would fail because there are uncommitted changes. You could commit them, but then they would be undone on your next repo sync. With git stash, it will save your uncommitted changes. Then you can apply the cherry picks, and then apply your changes again on top of them by running:

git stash apply

Note: that will work if you only have one stash or if your most recent stash is the one you want to apply, otherwise you will have to add the name of the stash as well. For reference on git stash command options like listing the stashes, diffs, etc. see this:

https://www.kernel.org/pub/software/scm/git/docs/git-stash.html