Git and Github

Git and Github

F2dcf6633971844e19ca96ea294ba976?s=128

高見龍

May 08, 2013
Tweet

Transcript

  1. 2.
  2. 7.
  3. 16.

    Git

  4. 22.

    Git

  5. 27.
  6. 28.
  7. 36.
  8. 39.

    on Mac: > brew install git on Ubuntu or some

    linux OS: > sudo apt-get install git-core or > sudo apt-get install git
  9. 44.

    set your username and email > git config --global user.name

    "eddie" > git config --global user.email "eddie@digik.com.tw" list all settings > git config --list
  10. 46.

    [alias] co = checkout br = branch aa = add

    --all l = "!source ~/.dotfiles/.githelper && pretty_git_log" https://github.com/kaochenlong/eddie-dotfiles
  11. 47.

    Exercise: 1. set your username and email for git. 2.

    edit the ".gitconfig" and add some aliases.
  12. 50.
  13. 52.
  14. 54.
  15. 57.
  16. 61.

    Exercise: try to check if "hello.rb" is in staging area,

    and then remove it from staging area.
  17. 62.
  18. 71.

    Exercise: in last commit, you forgot to add another file,

    but you don't want to commit again just for this single file, please try to commit it with -- amend.
  19. 73.

    if you still want to commit an empty folder, you

    can put an empty “.gitkeep” file in it by convention.
  20. 74.
  21. 81.
  22. 83.
  23. 90.

    Exercise: 1. create a new branch name "fruit" 2. checkout

    to "fruit" branch 3. add a "banana.rb" and commit it
  24. 93.

    Exercise: you just create a tag name “ncku”, try to

    checkout to this tag after several commits.
  25. 94.
  26. 96.

    Exercise: 1. checkout back to "master" branch 2. merge "fruit"

    to "master" 3. remove "fruit" branch if you like
  27. 100.
  28. 102.
  29. 106.
  30. 109.
  31. 112.

    on Mac: > brew install git-flow on Ubuntu or some

    linux OS: > sudo apt-get install git-flow https://github.com/nvie/gitflow/wiki/Installation
  32. 116.

    add a new feature: > git flow feature start my_new_feature

    when done with the new feature: > git flow feature finish my_new_feature
  33. 117.

    Exercise: your boss ask you to add a new feature

    which can let user upload their photos, please try to finish this assignment in git flow.
  34. 118.

    Exercise: your boss find a bug and ask you to

    fix it ASAP, please try to do this assignment in git flow.
  35. 119.
  36. 123.
  37. 131.
  38. 132.
  39. 134.
  40. 136.

    Exercise: 1. clone a project from Github 2. do some

    changes 3. commit and push back to Github
  41. 137.

    Exercise: 1. create a new local branch 2. add some

    change and then push this branch to Github
  42. 139.

    push a tag: > git push origin v2.0 push several

    tags: > git push origin --tags
  43. 141.
  44. 142.
  45. 144.

    Exercise: 1. fork a project from your classmate who is

    sitting just next to you. 2. add some change and commit. 3. fire a pull request.
  46. 151.

    Exercise: 1. create a github page for your account. 2.

    set your domain name in CNAME if you have one.