Skip to content

Bootcamp May 15 Git review, code convention and code rally

harleyttd edited this page Sep 13, 2010 · 1 revision

Git review

  • Mergetool:
    • Meld is recommended if you use linux gnome, kdiff3 if you use KDE. Do sudo apt-get install if you do not have it yet. Don’t use emerge unless you are an emacs fan.
  • The order of git command you use after you made some changes and wanna update:
    • git commit
    • git pull
    • fix any merging conflicts if exist:
      • use git status to check for files listed as “unmerged”
      • use git mergetool <filename> for each of those unmerged files
    • test your code to make sure it works. for now cucumber features is quite useful
    • use git status often. or just gst if you use my suggested aliases :-)
    • git push: only after you’re sure the code works,
  • Branching:
    • It is nice and you should take advantage of it
  • Git reset
    • git reset --hard if you want to discard your changes so far and go back to the latest commit point
    • to bring your code back to any of the earlier commit point:
      • git log to see the commit points so far and identify the point you want to go back
      • find the hash name listed next to that commit, for example: 36fbd567386a68407954332fd1e5a76f085c2316
      • use git reset 36fbd567386a68407954332fd1e5a76f085c2316 will make your latest commit this commit
      • your code is not changed yet, any code difference between your code and that commit is listed as “changed but not updated”
      • use git reset --hard to throw away such changes and bring your code back to what it was at that commit you just picked.
        • warning: now you will lose the code; may be a good idea to either stash it or check out to a different branch when you do this

Code convention

Maybe Ben or Adam can add it here.

Code rally

Great job guys. So some people wanted to implement something like nested layouts. I will cover it tomorrow.