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
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
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
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
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
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
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
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