GIT FirstPart
GIT FirstPart
GIT FirstPart
Elaine Ding
Digital Developer in Fenwick Library
George Mason University
1
Objectives
• Version Control
• Git , Git repository
• Git vs Github
• Setup git environment
• Create a git repository ( adding file, adding folder)
• Checkout different version/ignore files…
• Git tools
2
3
Why Version Control?
4
Version Control Systems
5
Why Git?
• Git :most commonly used software for tracking changes in any set of
files, usually used for coordinating work among programmers
collaboratively developing source code during software development.
• Git has many advantages over earlier systems such as CVS and
Subversion
Subversion Git
6
Git History
9
Download and install Git
• --global param
11
command description
Git Command
git clone url [dir]
git add files
copy a git repository so you can add to it
adds file contents to the staging area
git commit records a snapshot of the staging area
git status view the status of your files in the
working directory and staging area
git diff shows diff of what is staged and what is
modified but unstaged
git help [command] get help info about a particular command
git pull fetch from a remote repo and try to
merge into the current branch
git push push your new branches and data to a
remote repository
others: init, reset, branch, checkout, merge, log, tag
12
Adding a file to git repository
13
Adding a file to git repository
15
git diff HEAD~1 mars.txt
• $mkdir poem
• copy two text files to that poem folder
• $git add poem
16
Adding Multimpule files…
17
18
Checking previous version
19
Ignoring Things
21
Thank You
22