Are you handling client communication with email, updating your clients’ sites with FTP, making manual backups when you think of it, and crossing your fingers that everything gets done and nothing breaks? I’ve been there, and I’m here to tell you: it doesn’t have to be that way. In this talk, you’ll learn how to incorporate the git version control system and a ticketing system into your workflow to bring sanity and peace of mind to your development process, and why you don’t want to work on any collaborative project without them.
15. Either the client needs to provide it, or I will.
Versioncontrol
isnon-negotiable
Saturday, November 13, 2010
16. store step-by-step snapshots of your work
$ mate index.html
[make your changes]
$ git status
[see what’s changed]
$ git commit -am ‘changing jQuery version’
[commit any modified files already in the repo]
$ git push origin master
[send your changes to the server]
Saturday, November 13, 2010
19. see what you’ve done
$ git log
[see a history of the repo]
$ git log -p
[see a full diff for each log entry]
$ git log --stat
[see a short version of what changed per entry]
$ git log -SmethodName
[see commits whose diffs included ‘methodName’]
Saturday, November 13, 2010
22. streamline the process of deploying new code
to a server with tags
[locally ...]
$ git tag -a v1.3
$ git push --tags [tell the server about the tag!]
[then, on your server]
$ git pull
$ git checkout v1.3
Saturday, November 13, 2010
23. rapidly roll back bad code on the server
[on your server]
$ git checkout v1.3
[all hell breaks loose]
$ git checkout v1.2
[now to figure out what broke]
Saturday, November 13, 2010
24. identify the change that made your code break
$ git bisect start
$ git bisect good v1.2
[marks v1.2 tag as good]
$ git bisect bad master
[marks current code as bad]
[git will now present you with commits to test; each
should be marked with ‘git bisect good’ or ‘git bisect
bad’ until you arrive at the commit that broke]
Saturday, November 13, 2010
25. work on experimental changes without
breaking your stable code
$ git checkout -b newfeature
$ git branch
[confirm you’re on the newfeature branch]
[work on your new feature and commit as normal; commits
will not touch the “master” code]
Saturday, November 13, 2010
26. $ git pull --rebase
[gets any changes others have made]
$ git rebase master
[do this often & resolve conflicts early if you’re
working with others!]
$ git checkout master
$ git merge newfeature
[merge your changes back into master]
stay up to date with changes in the core code
Saturday, November 13, 2010
27. $ git add --patch
[choose which of your changes to add]
$ git commit -v
[see your diff when writing your commit message]
$ git stash
[stash your changes for now]
$ git stash pop
[restore your last stashed changes]
$ git rebase -i master~10
[edit (!) the last 10 commits]
more insanely useful things
Saturday, November 13, 2010