1 / 27

Introduction To Git

Introduction To Git. Presented by: Muhammad Rizwan Arshad (PSE) VTeams. Presented at: Nextbridge LHR C1. February 28, 2013. Version Control. System that records changes to a file or set of files over time You can recall specific versions later

quiana
Download Presentation

Introduction To Git

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction To Git Presented by: Muhammad RizwanArshad (PSE) VTeams Presented at: Nextbridge LHR C1 February 28, 2013

  2. Version Control • System that records changes to a file or set of files over time • You can recall specific versions later • Any type of file on a computer can be placed under version control. • Version Control Systems • Local Version Control Systems • Centralized Version Control Systems • Distributed Version Control Systems

  3. Local Version Control Systems

  4. Centralized Version Control Systems

  5. Distributed Version Control Systems

  6. GitVs Subversion • Distributed vsCenteralized. • Gitis incredibly fast and small as well. • Branches are even cheaper than they are in Subversion. • Branch merging is simpler and more automatic in Git. • Creating a repository is a trivial operation in Git. • The repository's internal file formats are incredible simple in Git.

  7. How Git works? • Snapshots, Not Differences • Nearly Every Operation Is Local • Git Has Integrity • Git Generally Only Adds Data

  8. The Three States

  9. First-Time Git Setup • gitconfig --global user.name “myname“ • gitconfig --global user.emailuser@example.com • gitconfig --global core.editoremacs • gitconfig --global merge.toolvimdiff • gitconfig --list user.name=“myname” • gitconfig user.name

  10. Getting a Git Repository • gitinit • git add *.c • git add README • git commit -m 'initial project version‘ • Clone a Repository: • gitclone git://github.com/schacon/grit.git mygrit

  11. File Status Life Cycle

  12. Recording Changes to the Repository • Checking the Status of Your Files • gitstatus • Tracking New Files • git add README • Ignoring Files • Edit .gitignore file • Committing Your Changes • gitcommit • git commit -m "Story 182: Fix benchmarks for speed"

  13. Viewing the Commit History • gitlog • gitlog -p -2 • git log –stat • git log --pretty=oneline • git log --since=2.weeks • Using a GUI to Visualize History • gitk

  14. What a Branch Is • A lightweight movable pointer • Default branch name is MASTER • What happens when you create a new commit ?

  15. What a Branch Is • Command “gitbranch testing” • How does Git know what branch you’re currently on?

  16. What a Branch Is • Switch to an existing branch • Command “git checkout testing”

  17. What a Branch Is • What is the significance of that? Well, let’s do another commit • Command “gitcommit -a -m 'made a change‘”

  18. What a Branch Is • Let’s switch back to the master branch • Command “git checkout master”

  19. What a Branch Is • Command “gitcommit -a -m 'made other changes‘”

  20. What a Branch Is

  21. Basic Branching and Merging Have a couple of commits already • you’re going to work on issue #53 • Is it issue-tracking system • Create a new branch • Command: git checkout –b iss53 • That is shorthand command

  22. Basic Branching and Merging git commit -a -m 'added a new footer [issue 53]' • git checkout -b hotfix • git commit -a -m • 'fixed the broken email address‘ • git checkout master

  23. Basic Branching and Merging • git merge hotfix • git branch -d hotfix • git checkout iss53 • git commit -a -m • 'finished the new footer [issue 53]‘ • git checkout master • git merge iss53

  24. Basic Branching and Merging

  25. Conflict Handling

  26. Questions?

More Related