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

Version Control

Nicanor
August 31, 2019

Version Control

Introduction to the version control(git and GitHub).

Nicanor

August 31, 2019
Tweet

Other Decks in Programming

Transcript

  1. ➔ Git ◆ Version Control System ◆ Git allows people

    to work on the same documents (often code) without stepping on each others toes ➔ GitHub ◆ GitHub is a development platform based on Git
  2. Why git? • Collaboration • Version you app - v1,

    v2, v3 ... • Widely used by many teams and platforms - E.g. GitHub, Google, Andela etc
  3. Why GitHub (github.com) • Huge Developer Community • Open source

    • Grow your developer profile • Learn • Collaborate with other developers
  4. Where can I learn? • Traversy Media Git Github crush

    course • Try Git • Git Exercises • Git handbook • Mentorship 101 - Version Control
  5. Know basic Linux commands E.g • cd • ls •

    sudo • Pwd • Editor - vi, vim, nano etc
  6. Git & Github Terms - Repository(Repo) - Directory/folder on local

    computer - Branch - independent working place (there’s always a default branch) - Pull - Fetch remote changes(githu) to local computer - Push - Send your local changes to github - Commit - Tag message to save/record your changes on git - Pull Request(PR) - Collection of all changes done in one branch
  7. - Merge - putting two branches together - Merge Conflicts

    - Found when same changes occur on the same file same location - Rebase - integrate changes from one branch to another - Revert - Undo changes done on commit history - Squash - Combine several Commit messages to one - Github Pages(gh-pages) - Server management provided by Github to host your projects - Clone - Obtain a repo from github to your local folder
  8. Link Git with Github Account - Download git - On

    terminal/Command Prompt, add configs credentials
  9. Do what git does best now i.e • Send your

    local project to github • Collaborate on a project with a friend
  10. First - Create a repo on Github - Open your

    project on the command prompt/terminal. cd Documents/projects/ALC4/
  11. Add a message/color - What changes has been made on

    the files - A descriptive message git commit -m “this is the first message initialising this project”
  12. Send your project to Github - Add the url of

    the github repo you created. git remote add origin REPO-URL - Push your project git push -u origin master
  13. Create a branch Git checkout -b new-branch - Implement feedback,

    then: - Git status - Git add your files or git add . - Git commit -m “feedback implementation” - Git push - Your friend want to check how you implemented - Pull a PR - Assign your friend as a reviewer
  14. Why PR? - Descriptive - Shows what you worked on(files

    changed) - Allows others to give more feedback
  15. After reviews & Approvals ? - Resolve merge conflicts -

    Merge it to the default branch/staging/production - Once deployed to production, versions are created