Github cheatsheet from Kabilash

Github cheatsheet from Kabilash

Git is a free and open source distributed version control system. There are several adoptions of the Git framework and one such popular application is GitHub. This cheat sheet features some of the most important and commonly used Git commands for easy reference.

Downloading Github

Git for All PlatformsGitHub for MacGitHub for Windows
htp://git-scm.comhtps://mac.github.comhtps://windows.github.com

Setting-up user credentials

CodeDefinition
git config --global user.name “[firstname lastname]”set a name that is identifiable for credit when review version history.
git config --global user.email “[valid-email]”set an email address that will be associated with each history marker.

Setup and Initialization

CodeDefinition
git initinitialize an existing directory as a Git repository.
git clone [url]retrieve an entire repository from a hosted location via URL.

Staging changes

CodeDefinition
git statusshow modified files in working directory, staged for your next commit.
git add [file] or git add .add a file as it looks now to your next commit (stage). git add . adds all the files in repository.
git commit -m “[descriptive message]”commit your staged content as a new commit snapshot.

Push and Pull changes from GIT

CodeDefinition
git push [branch]Transmit local branch commits to the remote repository branch
git pullfetch and merge any commits from the tracking remote branch.