-
Describe the purpose and benefits of version control
-
Describe the differences between centralized and distributed version control
-
Describe the purpose of the required configuration settings for git
-
Be able to initialize a new local repository
-
Describe the different stages of a typical local editing workflow
-
Perform an iteration of the local editing workflow
-
Browse the log of a repository
-
Reverse changes at different stages of the editing workflow
-
Configure the repository to ignore specific files
Chapter 15, Pgaes 349-365
-
Introduction to version control
a. What is version control
- backup a changing set of files
- store and access an annotated history of those files
- manage merging of changes between different set of changes
b. Centralized vs Distributed
-
Configuring
git
- set user name, email and editor
-
Why git in pure local configuration
-
Make your first git repository
- go to your
ep476-sandbox
- make a new directory
planets
and change to that directory - initialize with
git init
- explore what changed:
ls -a
&git status
- go to your
-
Discuss typical git workflow: edit, add, commit
-
Make your first commit
- make a file
mars.txt
that says "Cold and dry, but everything is my favorite color" - check the status - discuss
- add the file
- check the status - discuss
- commit the file
- check the status - discuss
- make a file
-
Review all changes
- git log - discuss
-
Make your first changes
- edit
mars.txt
to add "Two moons will make for interesting tides." - check the status - discuss
git diff
- discussgit commit
- does nothing - why?git add
git commit
git status
- discussgit log
- edit
-
Make another change
- edit
mars.txt
to add "Low humidity may make it hard to grow plants" git add
git status
git diff
- where are the changesgit diff --staged
git commit
git log
- different variations:--oneline
and--oneline --graph --all --decorate
- edit
-
Exploring the history
- commit hashes
- diff from a specific hash
HEAD
andHEAD~n
as shortcuts- show a specific commit
-
Undoing changes
- fresh changes - checkout
- staged changes - reset
- commited changes - revert
-
Ignoring files (removing clutter, avoiding mistakes)
- add a file called 'mars.dat'
- assuming we don't want to include these files in the repo
- create a file called '.gitignore'
git status
- add
*.dat
to this file
-
Discuss typical branching workflow: branch/checkout, {local edit}, merge
-
Create a branch
git branch venus
git checkout venus