Git is open-source version control software, which is used to manage and track file revisions. GitHub allows developers and engineers to create remote, public repositories on the cloud for free. A repository, or “repo” codes a project’s files and stores the revision history for each file. Once you’ve set up a repository on GitHub, you can copy it to your local directory, add and modify files locally, and then “push” your changes back to the repository where your changes are displayed for the public. Download Git
SETUP & INIT
- git init – Initialize an existing directory as a Git repository
- git clone [url] – Clone entire repository from a hosted location via URL
SETUP- Configuring user information used across all local repositories
- 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
STAGE & SNAPSHOT – Working with snapshots and the Git staging area
- git status – show modified files in working directory, staged for your next commit
- git add [file] – add a file as it looks now to your next commit (stage)
- git reset [file] – unstage a file while retaining the changes in working directory
- git diff – diff of what is changed but not staged
- git diff –staged – diff of what is staged but not yet commited
- git commit -m “[descriptive message]” – commit your staged content as a new commit snapshot