4  Working with git

The basic git workflow looks as follows:

flowchart LR
   a[make change] --> b[git add] --> c[git commit] --> d[git push]

  1. Make an edit. For example in one of your chapters. Save the edit (CNTR + S)
  2. Take a look whether git has recorded that you have made a change:
    1. Terminal:
      1. git status will list all the files which have been edited, but not committed.
      2. git diff YOURFILENAME will display what content of your file has been changed.
    2. RStudio:
      1. Click the Git tab on the top right of your screen. There, you will see which files have been edited, but not committed.
      2. Select a file from the list in the Git tab, and click Diff to see what content of the file has been changed.
  3. Commit the change [WIP]