getting started with gitjeremybytes.com/downloads/slides-gettingstartedwithgit.pdf · what is git?...
TRANSCRIPT
Getting Started with Git
Jeremy Clark
www.jeremybytes.com
What is Git?
• Distributed Source Control
• Works Off-Line
• Full functionality on the local machine
• Supports Remote Repositories
• GitHub is the most popular
• Full Source Control Features
• Change Tracking
• Branching / Merging
• History
• And more…
Centralized vs. Distributed
Centralized Source Control
• TFS, Visual Source Safe, others
• Central server is required
• Server has the “true” copy
• Checkout / locked files
• Server has full history
• Limited off-line features
Distributed Source Control
• Git, Mercurial, others (Git has won)
• Server is optional
• Each user has a “true” copy
• No locked files
• Each user has full history
• Full features available off-line
Interacting with Git
Command Line Git GUI Visual Studio 2013
Installation
Installation
• Git Bash Here
• Adds right-click menu to open Gitcommand environment
• bash is a Unix shell
• *I don’t use this
• Git GUI Here
• Adds right-click menu to open Gitgraphical environment
• *I don’t use this
Installation
• Use Git from Windows Command Prompt
• Add “git” to the path
• Allows git to be used from the command prompt
• *I use this
Installation
• Line Endings
• Windows-style = CRLF
• Carriage return & line feed
• Unix-style = LF
• Line feed
• This will impact code editors that don’t understand Unix-style.
• This will impact “diff” tools that do file comparisons.
Key Commands
• init
• Create a repository
• add / rm
• Include / exclude files from the repository (tracking)
• .gitignore
• File types to ignore
• status
• View unsaved changes
• commit
• Save changes
Branching
• branch
• Create a new branch
• checkout
• Change to a different branch
• merge
• Update branch with changes from another branch
• stash
• Temporary holding area (like “shelve”)
• Can create a new branch from a stash
Remote Repositories
• remote
• Configure a remote location
• push
• Move changes from local repository to remote repository
• pull
• Move changes from remote repository to local repository
Demo
Links
• Code Schoolhttps://try.github.io
• Git Documentationhttps://git-scm.com/docs
• MSDN Visual Studio Documentationhttps://msdn.microsoft.com/en-us/library/hh850437.aspx
• Git .gitignorehttps://github.com/github/gitignore
Thank You!
Jeremy Clark
• http://www.jeremybytes.com
• @jeremybytes