git config --global user.name "John Doe"
git config --global user.email name@domain.com
git config --global color.ui auto
Creating a brand new project?
git init
in a folder you want to add version control to- Create a repository for this project on GitHub
git remote add
, with a remote name (conventionally, "origin") and the GitHub repo URL
Cloning an existing project?
git clone
and the URL of the project you're cloning
-
Make changes to files
-
git status
to see files changed -
git diff
to see specific lines changed -
git add
files to "staged" status -
git commit
to create a checkpoint (with message) -
git push
to update remote repo to current state
git log
- shows commits and messagesgit checkout
- also does...- Reset changes made to unstaged file
- Change files to a specific commit
- Change files to a specific branch
git tag
- creates named checkpoint for easy return