GIT COMMANDS:
SETUP
Configuring user information used across all local repositories
git config --global [Link] “[firstname lastname]” – To set a name
git config --global [Link] “[valid-email]” – To set a email
SETUP & INIT
Configuring user information, initializing and cloning repositories
git init - initialize an existing directory as a Git repository.
git clone [url] - retrieve an entire repository from a host via http or ssh.
STAGE & SNAPSHOT
Working with snapshots and the Git staging area
git status - show modified files in working directory, for the next commit
git add [file] - add a file
git reset [file] - unstage a file while retaining the changes in working
directory
git diff - shows the differences between your working directory and the
staging area (also called the index). Specifically, it highlights the changes
that have been made to your files but have not yet been staged for the next
commit.
UPDATE
git push - Transmit local branch commits to the remote repository branch
git pull - fetch and merge any commits from the tracking the changed data
git rm [file] - delete the file from project and stage the removal for commit
git stash - Save modified and staged changes
BRANCH & MERGE
Isolating work in branches, changing context, and integrating changes
git branch - list your branches. a * will appear next to the currently active
branch
git branch [branch-name] - create a new branch at the current commit
git checkout - switch to another branch and check it out into your working
directory
git merge [branch] - merge the specified branch’s history into the current
one
git log - show all commits in the current branch’s history