Notes

Git for Beginners


Git Workflow

  1. (Pull remote changes - if collaborating)
  2. Work as normal, modify files
  3. Stage and inspect changes (diff)
  4. Commit changes with message
  5. Push changes to remote/server
  6. Repeat

Terminology

  • Pull: Get any changes that have been made on the server by yourself or collaborators so that your local copy of the project is up to date
  • Stage: Choose what changes that should be part of the current commit
  • Commit: Commit the staged changes to the version history with a short, descriptive message of what has been added/changed
  • Push: Sync your local changes to the remote server so that the server’s copy of the project is up to date
  • Diff: A representation of the changes between files in different commits or the current file and the latest commit

Diff

Only really works for text files. For binary files we can only see that a change has been made, not what that change was.

This means that you can absolutely have your Word document version controlled with Git, but Git will not be able to show you what changes have been made between versions (you can use the compare function built into Word for that).

Ignoring Files

Files that you don’t want to version control should be added to .gitignore.