102-03:
Version Control Systems (VCS):
- Log a history of changes to files for comparison/correction
- Local Version Control: Database of changes locally saved (on hard drive)
- Centralized Version Control (CVCS): Single server-side database accessible by multiple clients
- Distributed Version Control (DVCS): Use muitiple repositories to limit reliance on single database source (Git is one of these)
DVCS Features of Git
- Use of snapshot comparison to determine if local files may be used
- File validity check on each change (limits corruption & loss)
- Cloning of existing repository
Git file states:
- Committed: In local database
- Modified: Changes not committed
- Staged: Will be committed w/ next snapshot
Useful Git commands
$ git status
: outputs file state
$ git add filename
or git add *
track & stage files for commitment ( *
adds all repo files)
$ git commit -m "example commit comment"
: Commits staged files w/ message
$ git push origin master
: Pushes to remote repo “origin” (git default) from local repo “master” (default)
git stash
: temporarily sidelines changes, to be applied with git stash apply
git remote
: outputs remote handle names (use git remote -v
to output URLs as well)