Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SIT GitHub 101

SIT GitHub 101

Kanisorn S.

January 15, 2018
Tweet

More Decks by Kanisorn S.

Other Decks in Programming

Transcript

  1. GitHub 101 The way to write the code with others.

    ! 1 Kanisorn S, @firstziiz Alchemist
  2. TL;DR Because we need to record the History of the

    code, that why we use Git.
 Git is a version control system, a tool to manage your source code history.
 The simple usage of Git. Just “Clone”, “Add”, “Commit”, “Push”, “Pull”
 GitHub is a hosting service for Git repositories. Sometime like a social network of developers.
 Practice yourself. Save it all and show your work via GitHub. 2
  3. Why we need Git ? $ First Era. Save file

    to Folder and share the work with flash drive
 Problem: If someone work at home. What should we do ?
 $ Second Era. Store the work in Cloud. Like a Google Drive, Dropbox, Facebook Messenger, Etc.
 Problem: If someone delete the file in Cloud, What should we do?
 $ Present Era. Using Git for store the work and also tracking the history of code.
 Problem: I don’t know what is this ! 3
  4. What is Git & GitHub $ Git is a Version

    Control System (VCS) $ Allow programmers tracking the change of code and work together. $ Git Repository represent the box that store your code. $ Go to Youtube [Learning Git 01 - What is Git?]. $ GitHub is a hosting service for Git repositories. Sometime like a social network of developers. $ In Present. GitHub use for represent your skill in real world. $ Have a lot of feature for made you being the great developer. 5
  5. 6

  6. OK Let’s Try to use Git 1. Open GitHub and

    create Git Repository
 2. Open SourceTree and Click New… > Clone from URL
 3. Copy HTTPS Git URI. ( https://github.com/something/your-repo.git)
 4. Create file README.md in Git folder and add some text.
 5. Open Sourcetree and check File Status
 6. Check the file and write the commit message.
 7. Click Commit
 8. Go to History and see the first change.
 9. Edit file README.md and do (5.) to (8.) again
 10. Click Push and check your Repository in GitHub.com 7
  7. Let’s Try to use Git (Cont.) 11. Open Sourcetree and

    Delete your repository
 12. Assume you are change the laptop. Clone the repo again.
 13. OK. You are complete the super-basic Git usage !
 14. Open Sourcetree and see the history, watch the change.
 8
  8. 9 *

  9. FYI: Commit Message + + Commit message purposes is speed

    up the reviewing, help the future maintainers + Commit message must be clearly and short + Don’t write commit that can not understand, like a “bugs fixed” + Good pattern is “[ADD] เพิ่ม README.md” + Use a TYPE ( […] … ) to represent short description. Like a ADD, REMOVE, CHANGE, FIX + Using only Thai language , 10
  10. FYI: Gitignore + + A Gitignore file specifies intentionally untracked

    files that Git should ignore. + Create .gitignore and add line a path to ignore that in Git + For Example. In Java Project.
 https://github.com/firstziiz/Classroom
 https://github.com/firstziiz/WhereIsIt + Learn more. https://git-scm.com/docs/gitignore 12
  11. FYI: GitHub Wiki GitHub Wiki is a simple way to

    create document in your Github. Aj. Umaporn may be use Wiki to tracking your work or assignment. Big Open Source in the world use GitHub Wiki to write the how to use this program. Believe me, Very Simple to use ! 13