This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 5: Making a git commit

Git identity

face Josiah Wang

Before you can commit your files in the staging area, Git requires you to provide your identity for each commit. This is so that it can record who made the changes.

Use git config to set up your name and email that you will use to make any commits to this repo.

You only need to do this ONCE for the repo.

user@MACHINE:~/robot$ git config user.name "Josiah Wang"
user@MACHINE:~/robot$ git config user.email "my.email.address@imperial.ac.uk"

You can change your name or email at any time by re-running the above commands. Any new commits will use your new identity.

Use git config -l to check whether your identity has been saved correctly.

user@MACHINE:~/robot$ git config -l
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
user.name=Josiah Wang
user.email=my.email.address@imperial.ac.uk