Pro Yearly is on sale from $80 to $50! »

Version Control Using Git, Part I

Version Control Using Git, Part I

Part I of Version Control Using Git

23df83cefd42a57e7784bcc33527fe40?s=128

Clay Wells

June 13, 2013
Tweet

Transcript

  1. Version Control Using Git, I https://dbe.med.upenn.edu/biostat-research/ClayWells @ClayWells

  2. 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
  3. 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.
  4. Version Control Using Git, I Dictator and lieutenants workflow

  5. Version Control Using Git, I Integration manager workflow

  6. Version Control Using Git, I Centralized workflow

  7. Version Control Using Git, I Download http://git-scm.com/downloads Getting Started http://git-scm.com/book/en/Getting-Started

  8. Version Control Using Git, I Create an empty repository git

    init git add . git commit -m 'add initial project'
  9. 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
  10. Version Control Using Git, I View repository status git status

  11. Version Control Using Git, I

  12. Version Control Using Git, I Staging area stage only portions

    of a modified file
  13. Version Control Using Git, I Staging area add all changes

    to all files
  14. Version Control Using Git, I Add untracked files git add

    README.txt
  15. Version Control Using Git, I Commit modified files git commit

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

    – track git add file – stage git commit file - commit
  17. Version Control Using Git, I Ignore files cat .gitignore *.[oa]

    *~
  18. Version Control Using Git, I Feeling... ?

  19. Version Control Using Git, I Git can tag points in

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

    to a specific commit. Creating a lightweight tag git tag v0.1-stable-lw
  21. 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).
  22. 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
  23. Version Control Using Git, I Show tag data git show

    v0.1-stable
  24. Version Control Using Git, I Commit log git log git

    log -p -2 git log –pretty=oneline
  25. 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
  26. Version Control Using Git, I Revert git revert HEAD git

    revert $commit-id
  27. Version Control Using Git, I Tagging later git show –pretty=oneline

    git tag -a v0.2-ready -m 'v0.2 is ready' $commit-id
  28. 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'
  29. Version Control Using Git, I Removing a file git rm

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

    ssh://you@host.org/project.git ... git push git push --tags More in Version Control Using Git, II
  31. Version Control Using Git, I Feeling... ?

  32. Version Control Using Git, I Working with a Git GUI

    SourceTree: http://www.sourcetreeapp.com - example demonstration -
  33. 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
  34. Version Control Using Git, I Git ROCKS!!! Questions?