Git Back Control of Your Code – Learning How to Manage Your Code with Git & GitHub – What is Version Control?



Git Back Control of Your Code – Learning How to Manage Your Code with Git & GitHub – What is Version Control?

0 1


git-presentation

A talk from October 19, 2012 at Burlington Ruby on using Git

On Github brettchalupa / git-presentation

Git Back Control of Your Code

Learning How to Manage Your Code with Git & GitHub

Press [Space] To Progress

Who am I?

Brett Chalupa

What is Version Control?

define: version control

The task of keeping a software system consisting of many versions and configurations well organized.

Why use Version Control?

  • Confidence
  • Collaboration
  • Process

What is Git?

define: git

An extremely fast, efficient, distributed version control system ideal for the collaborative development of software.

Why use Git?

  • Distributed
  • Community
  • Tools

The Git Workflow

Initialize a Repo Make changes to the codebase Stage the modified files to be committed Commit the changes Push the changes

The Git Workflow

Creating a New Repository

git init git status git add changed_file.rb git commit -m "change some files" git push github master

The Git Workflow

Making Changes to an Existing Repository

git pull origin master git status git add changed_file.rb git commit -m "change some files" git push github master

The Git Workflow

Branching and Merging

git checkout -b bc/new_branch git status git add changed_file.rb git commit -m "change some files" git push github bc/new_branch

Other Useful Git Commands

            
              git diff # show the differences
              git branch -a # show all branches, locally and remotely

              git remote # list remotes
              git remote -v # list remotes with detail

              git reset --hard HEAD~1 # go back 1 commit before the head
              git remote rename origin github # rename a remote

              git stash # temporarily store your changes
              git stash pop # pop stashed changes back on top
              git stash drop # drop stashed changes
            
          

What is GitHub?

define: github

Online project hosting using Git.

Why use GitHub?

  • Pull Request
  • Gists
  • In-line Comments
  • Wikis
  • Repository Forking
  • Issue & Bug Tracking
  • Octocats

Try Git

http://try.github.com/

Additional Resources

Thank you!

http://brettchalupa.com

Blog Post