Sorry, I couldn't resist the little jab. This is actually a quick reference cheat sheet for a team of Rails developers (myself included) about to make the leap from Subversion to Git...
Your first time?
- Head on over to github.com
- Create an account.
- Generate a public key.
- Get a copy of the repository:
git clone git@github.com:trak3r/rss2twitter.git
- Move into the new directory:
cd rss2twitter
- You're ready to go!
Business as usual...
- Say you're assigned ticket 222.
- Make sure you have the latest code:
git pull
- Create a branch to work in (named after the ticket number):
git branch 222
- Switch to that branch:
git checkout 222
- Make your changes (and write lots of tests).
- Add the file(s) you've changed:
git add somefile.rb
- Make sure you didn't miss any:
git status
- Commit often (it's cheap):
git commit -m "a clear but brief summary of the changes"
- All done? Make sure all the tests pass!
- Switch back to the "master" branch.
git checkout master
- Merge your branch:
git merge 222
- Publish your changes back to the central repository so everybody else can get them:
git push
- You're done! (...as soon as you deploy to staging and assign the ticket back to the creator for validation.)