Git: Common usage scenario

  1. Checking out remote changes:
    git clone (very first time) or git pull (always afterward)
  2. Editing a file:
    E.g.: add a new function attack() to the player.js file
  3. Adding a file to "staging area" for the next commit:
    git add player.js
  4. Commit the modification to the local repository:
    git commit -m "Add player attack"
  5. Send local modifications to the remote repository:
    git push
  6. Resolution of any conflicts:
    File modification and commiting again (starting from step 3)

Note! If you start a project from scratch you do git init to create a new repository