Git Lecture 2
Git Lecture 2
Git Lecture 2
Course logistics
What is version control?
Why use a VCS (motivation)?
Brief history / evolution of version control
What is Git? Where does it fit in?
Agenda
Administration
Configuring Git
Basic git commands
File states
Getting Git
git clone git://github.com/gitster/git.git
Sorry for the confusion
Git Basics
Configuring Git
git config
Initializing a repository
git init, clone
Inspecting a repository
git status, log, diff
Modifying a repository
git add, rm, mv, commit
Getting Help
Additional reading
Email me!
Configuring Git
Etc.
Useful for you and others that work with your repo
Configuring Git
Configuring Git
Configuring Git
Color!
Getting a repository
Two ways of getting a repository
1. Cloning someone elses
2. Making your own
git init
git status
File States
Untracked
Unmodified
Modified
Staged
git add .
git commit
git commit
git commit
git commit -a
git commit
git rm
git rm
git rm <file>
git mv
Logging
git log
git log
diff'ing
git diff
git diff
.gitignore
.gitignore
[alex@pavilion c0co]$ cat .gitignore
*.swp
*.c0
*.o
*.hi
*.s
*.old
*.ll
a.out
a.result
a.output
No more commands!
Phew, thats it for now
Lot to take in, obviously cant remember all of
them
Best way to learn is to actually USE the
commands
Homework 2
Create a new repository at:
~/public/98174/hw2
Summary
Configuring Git
git config
Initializing a repository
git init, clone
Inspecting a repository
git status, log, diff
File states
Modifying a repository
git add, rm, mv, commit
Thank you!
Questions?