Git for Gits

  • Git: a distributed versioning and change management system used by software developers.
  • GitHub: cloud hosted Git repository server. Microsoft acquired it in a billion-dollar deal. Lets you backup your public/private repos for free.
  • GitLab: another cloud service. It adds CI/CD worfklows for software projects, on top of regular Git repositories. Basically offers an integrated build pipleine, to build, run tests, package, and deploy.

Git worfklow

  1. git commit: saves your modifications in your local repository
  2. git push: takes your locally committed changes, and publishes them to a remote repository for others to fetch at a subsequent time

the remote repo has an associated name.
The default remote is usually called origin
A remote url can be either HTTPS or SSH.

Step 1: Initialize a local Git repo

git init

## if you've got a new, unused git install locally
git config --global user.email "<userid@mailhost.com>"
git config --global user.name "<given_name family_name>"

Apple Mac Tips

macOS Finder creates metadata files called .DS_Store whenever you browse to your folder in Finder.
To avoid adding these to your Git repo, add it to your global .gitignore:

git config --global core.excludesfile ~/.gitignore_global
echo ".DS_Store" >> ~/.gitignore_global

And if you’ve already committed them to your project, clean up thus:

find . -name ".DS_Store" -delete