Git setup

getting some version control on your computer

notes2021-03-15 21:55

User setup

Username

When you make a commit, what would you want to show as your name?

  • Open your Terminal
  • Configure your GitHub account globally on your machine (remove --global if you wish to configure your account just for the current repository):
1$ git config --global user.name "username"

Let's confirm we have set this up correctly:

1$ git config --global user.name
2> username

E-mail address

When you make a commit, what would you want to show as your e-mail address?

  • Open Terminal
  • As in the above with a username:
1$ git config --global user.email "example@email.com"

Confirm:

1$ git config --global user.email
2> example@email.com

Repository (repo) setup

To create a repository (repo) for the current working folder (assuming you have created and entered into it already):

1$ git init

Remote repo setup

To connect the (already-created) remote version of our local repo:

1$ git remote add [remotename] [repoURL]

Replace:

Removing the remote repository

For whatever reason, we can also delete the remote with this command from the local working folder:

1$ git remote remove [remotename]