Version control system where two directories are copies of each other, one ersion is a little more evolved than the previous one.
Over 100 commands
Clone: This does 4 things 1) Create a new working directory (named after the repo server by deault), 2) initializes new git repo, 3) adds a remote called origin, 4) pull changes from the remote
$~ git clone "gitrepo here"
Figure out what's going on with your repo
$~ git status
Get rid of changes
$~ git checkout /index.html
The prompt, current git branch listed in parenthese
(master) $:
Master: every Git repo starts with a master branch that Git assigns the name master by default. This is the primary stable version of your project
(master) $: git branch
* master
Create: Create and checkout branches. This will create a local branch and automatically check it out.
$~ git checkout -b newbranchname
See all existing branches
$~ git branch -a
master
* newbranchname
Checkout an existing branch (LIKE MASTER)
$~ git checkout branchname
Phase 1: Keep your branch up to date with master. While working pull in the server's amster branch regularly, to reducte the risk of merge conflicts, and to help keep any conflicts that do occur as minimal as possible.
Git Pull: pull local commits from the remote repository
$~ git pull origin master
Phase 2: Stage your changes. The staging area is not synced or shared with anyone on your team –– it only lives on your local machine
Add: add all (or specific) directories & files to the staging area Analogous to building a house
$~ git add .
$~ git add path/to/file/index.html
Commit: Record snapshot of the current state of your entire project. This is JUST A REFERENCE (like the way a street address refers to a house)
$~ git commit -m "Commit Message Here"
Git push: push local commits to the remote repository
$~ git push origin master
Merge: Combine two (or more) different branches of your project into a unified version
Step 1: checkout the branch you want to merge to
$~ git checkout master
Step 2: Merge
$~ git merge branchname
Step 3: merge conflicts
Top conflict is version from current branch and bottom conflict is the one we're trying to merge in
Step 4: Staging change & telling git we've signed off on the current version
$~ git add index.html
$~ git commit -m "merge branch master into newbranchname"
Step 5: Delete Branch
$~ git branch -d branchname
Commit changes at regular intervals
Fast-forward easiest kind of merge