Unless you have a good reason you should be using git and GitHub for version control. One notable exception is many of our projects rely on SVN for localizers. We’ll be attempting to phase that out.
If you don’t know git or haven’t used it in a team, fear not! There are lots of awesome sites for git newbies. We recommend:
Next time you start a project, use git/GitHub! Working on a project by yourself is a bit different than working with others, but start with some basic git commands (clone, branch, merge) and some of the more wild stuff (multiple origins, rebasing, etc.) will make more sense.
New projects for Mozilla websites should start in the Mozilla account.
Contact jsocol, wenzel or peterbe to be added to individual projects you want to have your way with. They hang out in #webdev on IRC, which is a fine place to ask for access when you start at Mozilla.
GitHub has some service hooks that are helpful to Mozilla projects.
Contact davedash or wenzel to get access parameters for the hooks.
In order to work on a project:
You will want to keep your local master branch in sync. Typically you will rebase your branches with your master and ultimately you will push your master to origin/master.
Let’s assume you’ve defined your origin remote properly in GitHub. E.g. for Zamboni.
You will want your .gitconfig to have the following:
[branch "master"] remote = jbalogh merge = master rebase = true
In order to make life easier we maintain a repository of git-tools. These are shell scripts or python scripts that commit all kinds of magic.
Here’s a sampling:
Put these in your path and then fork and make your own tools and share.
fugitive.vim may very well be the best Git wrapper of all time.
hub is a git wrapper (or standalone tool) that allows deep integration of github into your command-line git workflow. You can easily clone, fork, pull-request, and checkout pull-requests locally. Read the page and install it now.
Oh My Zsh <https://github.com/robbyrussell/oh-my-zsh> is an excellent collection of zshell scripts that can make your zsh environment amazing. It includes a collection of plugins, including ones for git and Github.
Some of these overlap with git-tools. Additionally by using Oh My Zsh you can easily display your current branch and it’s dirtiness on your prompt.
Here is my prompt:
dash@awesomepants in ~/Projects/bootcamp/the_code/docs (bootcamp) ± on master!
See A Bugs Life
Sometimes you need to run someone else’s code locally. If they’ve given you a pull request, or a commit hash this is what you need to do to see there code:
git remote add davedash email@example.com:davedash/zamboni.git git fetch davedash git co davedash/branch