Create a new git repository:
Add a file to staging (index):
git add <filename or directory>
Enter and interactive staging add where you can choose portions a file to commit:
git add -p
Commit changes to HEAD:
git commit -m "Comments to include about this commit"
Add new changes to the most recent (latest) commit:
git commit --amend
Change only the last commit message:
git commit -amend -m "Here is my new shiny updated commit message"
Change most recent commited files without changing message (avoid as this can be very confusing to merge down later):
git commit -amend --no-edit
Take uncommitted changes (both unstaged and staged) and store them away for later:
git stash save "Descriptive message of changes being stashed"
Redoing stashed changes:
git stash pop
Redoing stashed changes, but keeping them in stash:
git stash apply
View all of the commit changes:
View all of the commit change logs:
Look at differences between working copy and index:
Update the username and email address used in commenting entries:
git config --global user.name "First Last or Alias"
git config --global user.email "email@example.com"
How to clone (download) a git repository on your local machine:
git clone <remote path to .git file>
How to push to remote repository:
How to pull from remote repository:
How to remove remote origin from local git repository:
git remote remove origin