Section outline

Main course page

  • Git is a powerful tool for programmers - it allows you to keep track of changes made to your code, compare and revert them.
    It is recommended to use Git when working on programming homework assignments, for example in Intro2CS.
    Luckily for you, the next few videos teach the basics of using Git!

    Note that you can use git on Windows and Mac too, if you follow these instructions.
    The command-line usage is exactly the same as shown in the videos.

    Optional reading material:
    Unit playlist

    Git tutorial
    Better Git It In Your Soul

    ------------------

    • The basics: a short introduction to version control.
    • In this video we will see how to set up the user info (using 'git config'), initialize a repository (using 'git init'), check the repo's status (using 'git status'), add files (using 'git add'), commit (using 'git commit'), and view the commit tree (using 'git log').
    • In this video we'll learn how to track changes to files, including changing file contents (using 'git add' and 'git commit'), moving/renaming files (using 'git mv'), deleting files (using 'git rm'), and viewing the difference between changes (using 'git diff').
    • In this video we'll learn how to revert committed changes (using 'git revert'), unstage staged changes (using 'git reset'), and undo changes that weren't even staged (using 'git checkout').

    • Gitting started - let's see if you've got the basics down!
      Optional reading material:
      Git cheatsheet

    • In this video we'll learn about branches - how to create them (using 'git branch'), how to merge them (using 'git merge'), and how to solve conflicts.
      Optional reading material:
      Learning git branching

    • In this video we'll learn what are remote repositories (in short - they'll allow us to work together with others on a single project). We'll also see how to fetch, pull and push to remote repos (using, how surprisingly, 'git fetch', 'git pull', and 'git push'), and how to open remote repos in github.
      Relevant links:
      HUJI's very own github
      (login using your CS username and password)

    • There are many GUIs for git, this is a brief example of using git with PyCharm, showing how to use git when working on an actual project, including adding, committing, pushing, pulling and merging.
      You can use PyCharm on Windows and Mac too, including all of the git functionality.
      Optional reading material:
    • Did you git git? We'll see now.

    • Meme for finishing this unit Page

      Once you finish this unit, you'll be able to open this page and see a meme!

      Not available unless: The activity Gitting started quiz is complete and passed