Git Tutorial PDF
Git Tutorial PDF
SSD TA
September 1, 2020
What is "version control" ?
Version 1
Server
Version 2 Computer
Version control is a system that records changes to a Version 3
file or set of files over time so that you can recall
specific versions
Version 1 Version 1
Version 2 Version 2
Version 3 Version 3
2
Computer A Computer B
Git Installation
• Windows - http://www.git-scm.com.
• Linux -
• apt-get install git
• yum install git
• Already installed in cygwin
3
Git Basics
4
Git Basics and status
• To start version controlling edited existing (new) files (tracking and committing to local
repository):
• git add filename
• git add (git add -A)
• git commit -m 'Commit message: what changes were introduced'
• git status
• Displays the state of the working directory and the staging area
5
Command Description
git clone url [dir] copy a Git repository so you can add to it
git add file 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
Git Commands
6
Creating a Git repo
• To fetch the most recent updates from the remote repo into your local repo, and put
them into your working directory:
– git pull origin master
• To put your changes from your local repo in the remote repo:
– git push origin master
9
Viewing the commit history
• git log
• Git logs allow you to review and read a history of everything that happens to a
repository
• Types :
• Directory Restricted Log
• Log by branch
10
Working with remotes
11
About wikis
• Host documentation for a repository in a wiki, so that others can use and contribute to
the project.
• Use repository's wiki to share long-form content about your project, such as how to use
it, how you designed it, or its core principles.
• Create links in wikis using the standard markup supported by your page, or using
MediaWiki syntax.
12
Markdown
13
Markdown
• It's very easy to make some words **bold** and other words *italic* with Markdown
• Headers
• # This is an <h1> tag
• ###### This is an <h6> tag
• Emphasis
• *This text will be italic*
• _This will also be italic_
• _You **can** combine them_ 14
Markdown
• Unordered
• * Item 1
• * Item 2
• * Item 2a
• * Item 2b
• Ordered
• Images
• 
• Format: 
15
Markdown
• Links
• http://github.com - automatic! • Inline code
• [GitHub](http://github.com) • I think you should use an
• `<addr>` element here instead.
• Blockquotes
• As Kanye West said:
• > We're living the future so
• > the present is our past.
16
Gists
• You can share single files, parts of files, and full applications with other people.
Directories can't be shared. You can access your gists at https://gist.github.com.
• Public gists show up in Discover, where people can browse new gists as they're created.
17
README and It’s Importance
• README file contains information about other files in a directory or archive of software
• Documenting any open source project should always begin with a good README so that
potential users can understand what your work is about.
• Few templates out there but a typical README usually contains sections for a
summary/introduction, installation, usage, dependencies, contributing information, and
license information.
18
THANK YOU