Git talk
Upcoming SlideShare
Loading in...5
×
 

Git talk

on

  • 295 views

 

Statistics

Views

Total Views
295
Views on SlideShare
291
Embed Views
4

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 4

http://tmp.samt.us 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Git talk Git talk Presentation Transcript

  • Git From basics to workflows
  • What is Version Control? Version Control (or Revision Control) allows tracking of changes throughout a collection of files. These files can be anything, but they are typically used to track changes of files containing code.
  • How does it work? Most people know version control in a centralized model (CVS, SVN), in that a single repository contains and controls all change records, logs, and other data associated with the project. Master John Jane Josh View slide
  • What's wrong with this model? If the master server is down or network connectivity is limited to nonexistent, the client cannot commit new changes nor typically access past revisions, remote branches, or other information not stored or cached locally. Master John Jane Josh I'm helpless View slide
  • Git is different Distribution solves the problem by making the client and the server the same, ensuring everyone has a full copy of the Repository and any changes made go to the local one first before being "pushed" to others. Master John Jane Josh
  • Git is different (cont.) This allows full, bi- directional communication between any two repos. In addition, work is committed locally prior to sending off the changes to anyone else. Master John Jane Josh
  • Git is different (cont.) However, most implementations of git infrastructure call for a master repository to which contributors will work on, similar to the centralized model, but ensuring each client has exactly the same data as the server. Master John Jane Josh
  • Using Git git init git add <file1> [...] git commit -m "msg" git push <remote> <branch> git pull <remote> <branch> git branch <branch> git checkout <branch> git merge <branch> git log git tag <tagname> Initialize a Repository Add File to stage area Commit staged files Push updates to remote Pull remote updates Create a new branch Change current branch Merge branch into current View commit activity Tag current state
  • Branches ● Are cheap ● Are local unless pushed ● Can be merged into each other
  • Branch Workflows One common workflow is to have a master and develop branch. master has stable code, develop is code that might not be stable. Programmers will commit and push to the develop branch and some sort of project leadership will merge the develop branch into the master when the time comes for a release.
  • Branch Workflows (cont.) This red line represents the master branch's history. master
  • Branch Workflows (cont.) The blue line is the develop branch. master develop
  • Branch Workflows (cont.) Each dot is a commit master develop John: Fixed bug #223 Jane: Added Widget Josh: Cleaned up doc/ directory
  • Branch Workflows (cont.) Each arrow is a merge into master master develop John: Merged develop into master John: Merged develop into master John: Merged develop into master
  • Branch Workflows (cont.) And each square is a tag master develop John Tagged: v1.0 John Tagged: v1.1 John Tagged: v1.2
  • Branch Workflows (cont.) This is the most common workflow for working in teams. The master server will see this the most. master develop
  • Branch Workflows (cont.) As presented, this model is kind of limited, as it forces everyone to put code in development on the develop branch. master develop
  • mail-unstable Branch Workflows (cont.) Members of projects can create unstable branches, branched off the develop branch, to work on features that will make the develop codebase unstable. master develop (Delete branch)
  • mail-unstable Branch Workflows (cont.) Sometimes, however, you might need to do a hotfix, which bypasses the typical development cycle. This is used sparingly, and is typically reserved for security issues. master develop (Delete branch) (Delete branch)