Version ControlBasics of Git                   References:                 http://gitref.orgFeb. 23, 2013   http://git-scm...
Outline       •   What is Version Control       •   Why Version Control       •   Git as Version Control ToolFeb. 23, 2013
WhatFeb. 23, 2013
What        Version ControlFeb. 23, 2013
What        Version Control                lets you track your filesFeb. 23, 2013
What        Version Control                lets you track your files                   so when you mess up you can easily  ...
WhyFeb. 23, 2013
Why       •   Backup and RestoreFeb. 23, 2013
Why       •   Backup and Restore       •   SynchronizationFeb. 23, 2013
Why       •   Backup and Restore       •   Synchronization       •   Track ChangesFeb. 23, 2013
Why       •   Backup and Restore       •   Synchronization       •   Track Changes       •   Track OwnershipFeb. 23, 2013
How      •   Repository                where files are being stored      •   Local Repository                repository in ...
Git: BasicsFeb. 23, 2013
Git: Basics       •   Get / Create RepositoryFeb. 23, 2013
Git: Basics       •   Get / Create Repository       •   Record ChangesFeb. 23, 2013
Git: Basics       •   Get / Create Repository       •   Record Changes       • Track   HistoryFeb. 23, 2013
Git: Basics       •   Get / Create Repository       •   Record Changes       • Track   History       •   Undo ThingsFeb. 2...
Git: Basics       •   Get / Create Repository       •   Record Changes       • Track   History       •   Undo Things      ...
git-clone                working                  staging                                          remote                 ...
Create / GetFeb. 23, 2013
Create / Get       •   get remote repositoryFeb. 23, 2013
Create / Get       •   get remote repository                git clone [repository url] [destination]Feb. 23, 2013
Create / Get       •   get remote repository                git clone [repository url] [destination]       •   existing di...
Create / Get       •   get remote repository                git clone [repository url] [destination]       •   existing di...
Record ChangesFeb. 23, 2013
Record Changes       •   Tracked FilesFeb. 23, 2013
Record Changes       •   Tracked Files                Files that are currently in the                repositoryFeb. 23, 2013
Record Changes       •   Tracked Files                Files that are currently in the                repository           ...
Record Changes       •   Tracked Files                Files that are currently in the                repository           ...
Record Changes       •   Tracked Files                Files that are currently in the                repository           ...
Tracking New FilesFeb. 23, 2013
Tracking New Files       git add [path/to/file|directory]Feb. 23, 2013
Tracking New Files       git add [path/to/file|directory]       git-add command adds files to the staging areaFeb. 23, 2013
Committing Staged FilesFeb. 23, 2013
Committing Staged Files       git commit -m "message"Feb. 23, 2013
Committing Staged Files       git commit -m "message"       git-commit command commits all staged filesFeb. 23, 2013
Ignoring FilesFeb. 23, 2013
Ignoring Files       •   Blank lines or lines starting with # are ignored.Feb. 23, 2013
Ignoring Files       •   Blank lines or lines starting with # are ignored.       •   Standard glob patterns work.Feb. 23, ...
Ignoring Files       •   Blank lines or lines starting with # are ignored.       •   Standard glob patterns work.       • ...
Ignoring Files       •   Blank lines or lines starting with # are ignored.       •   Standard glob patterns work.       • ...
Staged and Unstaged ChangesFeb. 23, 2013
Staged and Unstaged Changes        git diffFeb. 23, 2013
Staged and Unstaged Changes        git diff                 shows diff of what is modified but unstagedFeb. 23, 2013
Staged and Unstaged Changes        git diff                 shows diff of what is modified but unstaged        git diff --stag...
Staged and Unstaged Changes        git diff                 shows diff of what is modified but unstaged        git diff --stag...
Removing FilesRenaming FilesTracking HistoryFeb. 23, 2013
Removing Files        git rm [file/directory]Renaming FilesTracking HistoryFeb. 23, 2013
Removing Files        git rm [file/directory]Renaming Files        git mv current_file_name new_file_nameTracking HistoryFeb....
Removing Files        git rm [file/directory]Renaming Files        git mv current_file_name new_file_nameTracking History    ...
Undoing ThingsFeb. 23, 2013
Undoing Things        •   Unstaging staged fileFeb. 23, 2013
Undoing Things        •   Unstaging staged file                git reset HEAD <file>Feb. 23, 2013
Undoing Things        •   Unstaging staged file                git reset HEAD <file>        •   Unmodifying modified fileFeb. ...
Undoing Things        •   Unstaging staged file                git reset HEAD <file>        •   Unmodifying modified file     ...
Undoing Things        •   Unstaging staged file                git reset HEAD <file>        •   Unmodifying modified file     ...
Sharing / Updating FilesFeb. 23, 2013
Sharing / Updating Files        Remote RepositoriesFeb. 23, 2013
Sharing / Updating Files        Remote Repositories               are versions of your project that are hosted over the   ...
Sharing / Updating Files        Remote Repositories               are versions of your project that are hosted over the   ...
Sharing / Updating Files        Remote Repositories               are versions of your project that are hosted over the   ...
Sharing / Updating Files        Remote Repositories               are versions of your project that are hosted over the   ...
Sharing / Updating Files        Remote Repositories               are versions of your project that are hosted over the   ...
Remote RepositoryFeb. 23, 2013
Remote Repository      •   Show remote repositoryFeb. 23, 2013
Remote Repository      •   Show remote repository            git remote -vFeb. 23, 2013
Remote Repository      • Show remote repository          git remote -v      • Add remote repositoryFeb. 23, 2013
Remote Repository      • Show remote repository          git remote -v      • Add remote repository          git remote ad...
Remote Repository      • Show remote repository          git remote -v      • Add remote repository          git remote ad...
Remote Repository      • Show remote repository          git remote -v      • Add remote repository          git remote ad...
Remote Repository      • Show remote repository          git remote -v      • Add remote repository          git remote ad...
Remote Repository      • Show remote repository          git remote -v      • Add remote repository          git remote ad...
Remote Repository      • Show remote repository           git remote -v      • Add remote repository           git remote ...
Remote Repository      • Show remote repository           git remote -v      • Add remote repository           git remote ...
Version control
Upcoming SlideShare
Loading in...5
×

Version control

182

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
182
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Version control

  1. 1. Version ControlBasics of Git References: http://gitref.orgFeb. 23, 2013 http://git-scm.com
  2. 2. Outline • What is Version Control • Why Version Control • Git as Version Control ToolFeb. 23, 2013
  3. 3. WhatFeb. 23, 2013
  4. 4. What Version ControlFeb. 23, 2013
  5. 5. What Version Control lets you track your filesFeb. 23, 2013
  6. 6. What Version Control lets you track your files so when you mess up you can easily get back to a previous working versionFeb. 23, 2013
  7. 7. WhyFeb. 23, 2013
  8. 8. Why • Backup and RestoreFeb. 23, 2013
  9. 9. Why • Backup and Restore • SynchronizationFeb. 23, 2013
  10. 10. Why • Backup and Restore • Synchronization • Track ChangesFeb. 23, 2013
  11. 11. Why • Backup and Restore • Synchronization • Track Changes • Track OwnershipFeb. 23, 2013
  12. 12. How • Repository where files are being stored • Local Repository repository in the local machine • Remote Repository are versions of your project that are hosted over the Internet or network somewhereFeb. 23, 2013
  13. 13. Git: BasicsFeb. 23, 2013
  14. 14. Git: Basics • Get / Create RepositoryFeb. 23, 2013
  15. 15. Git: Basics • Get / Create Repository • Record ChangesFeb. 23, 2013
  16. 16. Git: Basics • Get / Create Repository • Record Changes • Track HistoryFeb. 23, 2013
  17. 17. Git: Basics • Get / Create Repository • Record Changes • Track History • Undo ThingsFeb. 23, 2013
  18. 18. Git: Basics • Get / Create Repository • Record Changes • Track History • Undo Things • Sharing / Updating FilesFeb. 23, 2013
  19. 19. git-clone working staging remote local repo directory area repo git-add git-commit git-push git-reset git-fetch git-checkout git-pull git-diff git-diff --stagedFeb. 23, 2013Feb. 23, 2013
  20. 20. Create / GetFeb. 23, 2013
  21. 21. Create / Get • get remote repositoryFeb. 23, 2013
  22. 22. Create / Get • get remote repository git clone [repository url] [destination]Feb. 23, 2013
  23. 23. Create / Get • get remote repository git clone [repository url] [destination] • existing directoryFeb. 23, 2013
  24. 24. Create / Get • get remote repository git clone [repository url] [destination] • existing directory git init [path/to/directory|file]Feb. 23, 2013
  25. 25. Record ChangesFeb. 23, 2013
  26. 26. Record Changes • Tracked FilesFeb. 23, 2013
  27. 27. Record Changes • Tracked Files Files that are currently in the repositoryFeb. 23, 2013
  28. 28. Record Changes • Tracked Files Files that are currently in the repository - unmodified, modified, stagedFeb. 23, 2013
  29. 29. Record Changes • Tracked Files Files that are currently in the repository - unmodified, modified, staged • Untracked FilesFeb. 23, 2013
  30. 30. Record Changes • Tracked Files Files that are currently in the repository - unmodified, modified, staged • Untracked Files Everything elseFeb. 23, 2013
  31. 31. Tracking New FilesFeb. 23, 2013
  32. 32. Tracking New Files git add [path/to/file|directory]Feb. 23, 2013
  33. 33. Tracking New Files git add [path/to/file|directory] git-add command adds files to the staging areaFeb. 23, 2013
  34. 34. Committing Staged FilesFeb. 23, 2013
  35. 35. Committing Staged Files git commit -m "message"Feb. 23, 2013
  36. 36. Committing Staged Files git commit -m "message" git-commit command commits all staged filesFeb. 23, 2013
  37. 37. Ignoring FilesFeb. 23, 2013
  38. 38. Ignoring Files • Blank lines or lines starting with # are ignored.Feb. 23, 2013
  39. 39. Ignoring Files • Blank lines or lines starting with # are ignored. • Standard glob patterns work.Feb. 23, 2013
  40. 40. Ignoring Files • Blank lines or lines starting with # are ignored. • Standard glob patterns work. • You can end patterns with a forward slash (/) to specify a directory.Feb. 23, 2013
  41. 41. Ignoring Files • Blank lines or lines starting with # are ignored. • Standard glob patterns work. • You can end patterns with a forward slash (/) to specify a directory. •You can negate a pattern by starting it with an exclamation point (!).Feb. 23, 2013
  42. 42. Staged and Unstaged ChangesFeb. 23, 2013
  43. 43. Staged and Unstaged Changes git diffFeb. 23, 2013
  44. 44. Staged and Unstaged Changes git diff  shows diff of what is modified but unstagedFeb. 23, 2013
  45. 45. Staged and Unstaged Changes git diff  shows diff of what is modified but unstaged git diff --stagedFeb. 23, 2013
  46. 46. Staged and Unstaged Changes git diff  shows diff of what is modified but unstaged git diff --staged shows the changes that will currently go into the next commit.Feb. 23, 2013
  47. 47. Removing FilesRenaming FilesTracking HistoryFeb. 23, 2013
  48. 48. Removing Files git rm [file/directory]Renaming FilesTracking HistoryFeb. 23, 2013
  49. 49. Removing Files git rm [file/directory]Renaming Files git mv current_file_name new_file_nameTracking HistoryFeb. 23, 2013
  50. 50. Removing Files git rm [file/directory]Renaming Files git mv current_file_name new_file_nameTracking History git logFeb. 23, 2013
  51. 51. Undoing ThingsFeb. 23, 2013
  52. 52. Undoing Things • Unstaging staged fileFeb. 23, 2013
  53. 53. Undoing Things • Unstaging staged file git reset HEAD <file>Feb. 23, 2013
  54. 54. Undoing Things • Unstaging staged file git reset HEAD <file> • Unmodifying modified fileFeb. 23, 2013
  55. 55. Undoing Things • Unstaging staged file git reset HEAD <file> • Unmodifying modified file git checkout -- <file>Feb. 23, 2013
  56. 56. Undoing Things • Unstaging staged file git reset HEAD <file> • Unmodifying modified file git checkout -- <file> These commands are actually suggested when running git-status commandFeb. 23, 2013
  57. 57. Sharing / Updating FilesFeb. 23, 2013
  58. 58. Sharing / Updating Files Remote RepositoriesFeb. 23, 2013
  59. 59. Sharing / Updating Files Remote Repositories are versions of your project that are hosted over the Internet or network somewhere.Feb. 23, 2013
  60. 60. Sharing / Updating Files Remote Repositories are versions of your project that are hosted over the Internet or network somewhere. • Show remote repositoryFeb. 23, 2013
  61. 61. Sharing / Updating Files Remote Repositories are versions of your project that are hosted over the Internet or network somewhere. • Show remote repository • Add remote repositoryFeb. 23, 2013
  62. 62. Sharing / Updating Files Remote Repositories are versions of your project that are hosted over the Internet or network somewhere. • Show remote repository • Add remote repository • Update/Sync remote repositoryFeb. 23, 2013
  63. 63. Sharing / Updating Files Remote Repositories are versions of your project that are hosted over the Internet or network somewhere. • Show remote repository • Add remote repository • Update/Sync remote repository • Inspect remote repositoryFeb. 23, 2013
  64. 64. Remote RepositoryFeb. 23, 2013
  65. 65. Remote Repository • Show remote repositoryFeb. 23, 2013
  66. 66. Remote Repository • Show remote repository git remote -vFeb. 23, 2013
  67. 67. Remote Repository • Show remote repository git remote -v • Add remote repositoryFeb. 23, 2013
  68. 68. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url]Feb. 23, 2013
  69. 69. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repositoryFeb. 23, 2013
  70. 70. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repository git push [alias] [branch]Feb. 23, 2013
  71. 71. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repository git push [alias] [branch] • Sync with remoteFeb. 23, 2013
  72. 72. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repository git push [alias] [branch] • Sync with remote git pull [alias] [branch]Feb. 23, 2013
  73. 73. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repository git push [alias] [branch] • Sync with remote git pull [alias] [branch] • Inspect remote repositoryFeb. 23, 2013
  74. 74. Remote Repository • Show remote repository git remote -v • Add remote repository git remote add [alias] [repository url] • Update remote repository git push [alias] [branch] • Sync with remote git pull [alias] [branch] • Inspect remote repository git remote show [alias]Feb. 23, 2013
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×