Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Version Control Using Git, Part I

Version Control Using Git, Part I

Part I of Version Control Using Git

Clay Wells

June 13, 2013
Tweet

More Decks by Clay Wells

Other Decks in Technology

Transcript

  1. Version Control Using Git, I Git is a free and

    open source distributed version control system. Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. http://git-scm.com/book/en/Getting-Started-About-Version-Control
  2. Version Control Using Git, I Any workflow Because of Git's

    distributed nature and branching system, an almost endless number of workflows can be implemented with relative ease.
  3. Version Control Using Git, I Create an empty repository git

    init git add . git commit -m 'add initial project'
  4. Version Control Using Git, I Create README.txt vi README.txt i

    to enter edit mode esc to exit edit mode :qw to quit & write
  5. Version Control Using Git, I Commit modified files git commit

    README.txt git commit -a enter commit log message
  6. Version Control Using Git, I Rinse, Lather, Repeat create file

    – track git add file – stage git commit file - commit
  7. Version Control Using Git, I Git can tag points in

    history as being important. Git uses two main types of tags: lightweight & annotated
  8. Version Control Using Git, I Lightweight tags Just a pointer

    to a specific commit. Creating a lightweight tag git tag v0.1-stable-lw
  9. Version Control Using Git, I Annotated tags (recommended) Stored as

    full objects in the Git database They’re checksummed; contain the tagger name, e-mail, and date; have a tagging message; can be signed and verified with GNU Privacy Guard (GPG).
  10. Version Control Using Git, I Creating an annotated tag git

    tag -a v0.1-stable -m 'version 0.1 is stable' List Tags git tag
  11. Version Control Using Git, I Commit log git log git

    log -p -2 git log –pretty=oneline
  12. Version Control Using Git, I Git tree roles The HEAD

    - last commit snapshot, next parent The Index - proposed next commit snapshot The Working Directory - sandbox
  13. Version Control Using Git, I Tagging later git show –pretty=oneline

    git tag -a v0.2-ready -m 'v0.2 is ready' $commit-id
  14. Version Control Using Git, I Renaming a file cp example.txt

    example.md git rm example.txt git add example.md git commit -m 'renaming a file'
  15. Version Control Using Git, I Removing a file git rm

    example.txt git commit -m 'removing example.txt'
  16. Version Control Using Git, I Server workflow (origin) git clone

    ssh://[email protected]/project.git ... git push git push --tags More in Version Control Using Git, II
  17. Version Control Using Git, I Working with a Git GUI

    SourceTree: http://www.sourcetreeapp.com - example demonstration -
  18. Version Control Using Git, I Resources Git Website - http://git-scm.com

    Git Documentation - http://git-scm.com/doc Git Book (on-line, PDF) - http://git-scm.com/book Git GUI - http://www.sourcetreeapp.com