Git presentation
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Git presentation

on

  • 1,944 views

 

Statistics

Views

Total Views
1,944
Views on SlideShare
1,944
Embed Views
0

Actions

Likes
4
Downloads
57
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Git presentation Presentation Transcript

  • 1. whoami ?? Vikas S Yaligar @vikasyaligarhttps://github.com/vikassy
  • 2. Why learn git??To manage your Project repository Sharing your code via github Contributing to others code
  • 3. Contents➢ Git Introduction➢ Git Basic Commands➢ Git Branching & Merging➢ Github Introduction➢ Your app in Github➢ How to Contribute?
  • 4. Git Is Open Source Version control System Tool for keeping a history on theDistributed Revision control state of your source codeSource code management projects.
  • 5. Im an egotistical bastard,and I name all myprojects after myself. FirstLinux, now git Linus Torvalds
  • 6. InstallationOn Linux sudo apt-get install git Version of gitOther systems git --version http://git-scm.com/
  • 7. Git work flow
  • 8. Git Basic Commandsgit init //initializes gitgit status //prints status of current repogit diff //prints difference made in filesgit add filename //adds file namegit commit -m “Message here :P” //saved!!git log //history
  • 9. git initCreates a .git file in current folder Why??
  • 10. BecauseTo tell git from where the file must be tracked !!!
  • 11. git add To add particular files/folders to commitExamples:git add .git add test.cgit add somedirectory/file
  • 12. How do I know which are added ? Using git status
  • 13. git status Tells usabout untracked files and files added to commit How do i know what are the changes?
  • 14. git diffTells the changes made in files
  • 15. git commitgit commit -m “message here” -m => messagegit commit -am “message here:P”-a => To add the modified files and then commit Message is compulsory !!
  • 16. git logTo show all commits with messages,check sum andmany more Checksum is always unique to each commit Can also use gitk, a commit viewer of git
  • 17. How does it work??
  • 18. .gitignoreTells git what to Ignore
  • 19. Status & Review✔ Git Introduction✔ Git Basic Commands➢ Git Branching & Merging➢ Github Introduction➢ Your app in Github➢ How to Contribute?
  • 20. Git Branching & Merginggit branch //Shows all branches of currrent repo
  • 21. Git creating branchesGit branch branch_name
  • 22. Commit in Branchgit checkout branch_name Goes to the branchgit add .git commit -am “Message”
  • 23. Other optionsgit checkout -b branch_nameCreates new branch and goes to that branchgit branch -d branch nameDeletes the given branch
  • 24. Merging git merge master branch_nameUsed to merge your work with master
  • 25. After merging
  • 26. Oh! I have to go back to last commit !!! How do I do that ???
  • 27. git checkout checksum_number You will have same status as that commits data !!Concept: It goes to a no branch state, one canmake edits and also commit. But then you need tocreate that into new branch
  • 28. Status & Review✔ Git Introduction✔ Git Basic Commands✔ Git Branching & Merging➢ Github Introduction➢ Your app in Github➢ How to Contribute?
  • 29. Github
  • 30. Who uses github ??? Many More !!!!
  • 31. GitHub is the best way to collaborate with others. Fork, send pull requestsand manage all your public and private git repositories.
  • 32. Creating a new repo
  • 33. Git remoteA remote in Git is basically a way to tell Git whereanother version of your repository is. Then you can ask Git to fetch data from it that you don’t have yet, or push your commits up to it (if you have write access).Git remote add origin https://github.com/username/project.git
  • 34. Fork a repo !!
  • 35. Git clonegit clone new_repo_url your_nameCreates a repo by your_name
  • 36. Adding upstreamgit remote add upstreamhttps://github.com/username/rep.git Adds remote named upstream for your current repo
  • 37. Fetch git fetch upstreamFetches all the changes made to the original repo fromwhom you have forked
  • 38. Merge Git merge upstream/masterMerges the upstream with master branch
  • 39. Git pullDirectly pulls the update from the original repo to yourcurrent working repo
  • 40. There is a lot more to be learnt Thank you !!● Credits:● 1)Chandramouli , 3rd year , BTech.● 2)Tushar Makkar , 2nd year, BTech.● 3)Pramati , 2nd year , BTech .