INTRODUCTION TO GITHUB INSTRUCTOR – ZACH MARTIN

21 Slides2.78 MB

INTRODUCTION TO GITHUB INSTRUCTOR – ZACH MARTIN

INITIAL RESOURCES AND INTRODUCTIONS https://github.zach-martin.com A quick introduction – Zach Martin 15 years IT experience Father to a seventeen-month-old baby girl 5 years professional software development experience

PRESENTATION OBJECTIVES Agnostic view of git, separate from GitHub The how and why of using git Labs involving both command-line and GUI driven git interaction Branching strategies and conventions Basic GitHub Features Quickly create your own repo Understand basic features and details about your repo

GITHUB USES GIT (SURPRISE!) What is git? Git is a VCS (Version Control System) Examples of other VCS Subversion CVS Mercurial Monotone

VERSION CONTROL SYSTEM Any VCS should have at minimum the following: Complete history of changes for all files Branching and merging by authorized users Traceability Does Software Development Require VCS? Strictly speaking – no (but you’ll regret it!)

OK, SO WHY GIT? Works offline Branching is easy Merging is easy Full history is kept in each repository copy It’s fast really fast!

OK, SO WHY GIT? (CONTINUED)

IMPORTANT TERMS Repository Clone Branch Status Add/Stage Commit Merge Push Pull Fetch Rebase Fork

LAB 1 – PART 1 Install Visual Studio Code Install git-scm Open git-bash (MacOS users should use terminal instead) Let git know who you are git config --global user.email "[email protected]" git config --global user.name "My Name“ git config -l Alternatively, you can use the following commands to explicitly pull this information git config --get user.name git config --get user.email

LAB 1 – PART 2 Create a repository in github Repository will be initialized by github Clone repository Create branch Make change Commit change Push Merge branch

BRANCHING STRATEGIES - GITFLOW

BRANCHING STRATEGIES – GITFLOW (CONT.)

BRANCHING STRATEGIES – GITFLOW (CONT.)

BRANCHING STRATEGIES – GITFLOW (CONT.)

CONFLICT IS INEVITABLE Unless you are working on a project by yourself, it will likely be almost impossible to avoid merge conflicts Managing conflicts can be challenging Different strategies exist, but our next lab will be the most likely resolution strategy Rebasing is another strategy we’ll discuss post-lab

LAB 2 For this lab, we’ll use GitHub Desktop Use the repository we created as our starting point Create a new branch, the name is unimportant Switch back to master (GitHub Desktop switches to the newly created branch by default) Update the README.md file Commit changes Switch to your new branch Update the README.md file on the same line Commit changes Switch to master branch Attempt to merge your new branch into master Resolve conflict

REBASE – TREAD CAREFULLY

REBASE – TREAD CAREFULLY (CONT.)

REBASE – TREAD CAREFULLY (CONT.)

GITHUB FEATURES AND NEXT STEPS Commit History Pull Requests Settings Features Access Branch Protection Notifications Additional Resources Found at http://github.zach-martin.com/resources.html

PRESENTATION END – OPEN LAB AND QUESTIONS Can’t think of a question or need to leave before I can answer? No worries! Send me an email – [email protected] Hope to see most of you in the GitHub Advanced Class!

Back to top button