Git basic


Published on

In this presentation I try to give the basic concepts and commands about Git. By which anyone can start versioning and Enjoy the Git.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Git basic

  1. 1. Git BasicsMd. Emran Ul HadiSoftware Engineer WNeeds Ltd
  2. 2.             What well cover• Concept of Version control system• Concept of Git• Some basic commands
  3. 3.             Version controlMost used Concurrent version system(CVS) andSubversion(SVN).Key concepts: • Central source control system • users check code into server • requires connection to the server to perform commits, updates etc.        
  4. 4.                     Git ???????• Distributed Version Control System•  Like sub-version but better...• Created by Linus Torvald
  5. 5.             WHY Git??????   Distributed repository • Self contained • Full history of commit •  You can commit/branch/merge locally • Read fast and offline •  No "latest revision": revision unique ID
  6. 6.                     Get Started
  7. 7.                 Git Started            getting started • move to a directory with code you’d like to manage with git: # git init • you’ve now created your first git repository! For remote repository access: # git clone remote_git_repository_url Example: # git clone
  8. 8.                     Work Flow  
  9. 9.                      Useful basics commands     git init ‣ repository setup  git add ‣ add files to queue for next commit  git commit ‣ commit queued files  git push ‣ push commit(s) to remote repository  git pull ‣ fetch changes from remote repository  git clone ‣ clone repository into a local directory   .gitignore ‣ ignore specific files by adding them here
  10. 10.                 Continue...git status ‣ Show uncommited changesgit rm  ‣ Remove a file from a repositorygit mv ‣ Move a file within repositorygit diff ‣ Generate a differences between     multiple commitsgit log ‣ View a log of commits
  11. 11.                     Git Level    
  12. 12.                     Branches
  13. 13.                    Branchinggit branch new_branch  create new branchgit branch -b feature2 create new branch and switch to that branchgit commit save some workgit checkout master  switch backgit merge feature2 work is merged ingit rebase feature2 work played on topgit branch -d feature2 delete branch
  14. 14.             tagging and merginggit merge branch_name Merge changes from branch_name to the current branchgit tag -a name Add a tag with a indicated namegit tag -l List tagsgit push --tags Push tags to remote repository
  15. 15.      Handling Some critical situation • Changing your last commit             #  git commit --amend      • Unstaging a staged File                # git reset HEAD FILE_NAME • Unmodifying a modified File              # git checkout -- FILE_NAME
  16. 16.           Some rules have to follow• NEVER pull when you have uncommitted changes - commit your work first.• First PULL then PUSH• If working on a feature, use a local branch, then this leaves the master open for other fixes.        
  17. 17. Lets Discuss
  18. 18.                  Resources•                   [For basics commands]•• searchfrom=header&q=git