Git is the free and open-source distributed version control system that’s responsible for everything GitHub related that happens locally on your computer.

Installation & GUIS

GitHub for Windows

https://windows.github.com

GitHub for Mac

https://mac.github.com

GitHub for All Platforms

http://git-scm.com

Setup

Configuring user information used across all local repositories

Set a name that is identifiable for credit when reviewing the version history

git config –global user.name “[firstname lastname]”

Set an email address that will be associated with each history marker

git config –global user.email “[valid-email]”

Set automatic command line coloring for Git for easy reviewing

git config –global color.ui auto

Init

Configuring user information, initializing and cloning repositories

Initialize an existing directory as a Git repository

git init

Retrieve an entire repository from a hosted location via URL

git clone [url]

Stage & Snapshot

Working with snapshots and the Git staging area

Show modified files in the working directory, staged from your next commit

git status

Add a file as it looks now to your next commit (stage)

git add [file]

Unstage a file while retaining the changes in the working directory

git reset [file]

Diff of what is changed but not staged

git diff

Diff of what is staged but not yet committed

git diff –staged

Commit your staged content as a new commit snapshot

git commit -m “[descriptive message]”

Branch & Merge

Isolating work in branches, changing context, and integrating changes

List your branches.a*will appear next to the currently active branch 

git branch

Create a new branch at the current commit

git branch [branch-name]

Switch to another branch and check it out in your working directory

git checkout

Merge the specified branch’s history into the current one

git merge [branch]

Show all commit in the current branch’s history

git log

Thank you for reading this article, I really appreciate it. If you have any questions, feel free to leave a comment.

%d bloggers like this: