Github By Nyros Developer


Published on

A popular distributed version control system designed to handle very large projects with speed and efficiency.

Published in: Self Improvement, Technology
  • Be the first to comment

  • Be the first to like this

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

No notes for slide

Github By Nyros Developer

  1. 1. GIT Global Information Tracking
  2. 2. Contents <ul><li>What is GIT? </li></ul><ul><li>Why GIT? </li></ul><ul><li>Normal Work flow? </li></ul><ul><li>Branching / Merging? </li></ul><ul><li>Why branching with GIT is awesome? </li></ul><ul><li>Local and Remote operations </li></ul><ul><li>Work flow with commands </li></ul><ul><li>Sample screens </li></ul>
  3. 3. What is GIT? <ul><li>A popular distributed version control system designed to handle very large projects with speed and efficiency. </li></ul><ul><li> </li></ul>
  4. 4. Why GIT? <ul><li>• Open source </li></ul><ul><li>• Easy to use and share your code efficiently </li></ul><ul><li>• Extremely fast, even with large projects </li></ul><ul><li>• Unlimited Repositories </li></ul><ul><li>• Unlimited branches </li></ul><ul><li>• Community </li></ul>
  5. 6. Staging files <ul><li>. git add [file names] </li></ul><ul><li>• add all changed files to the staging area: </li></ul><ul><li>git add . </li></ul><ul><li>• these changes are NOT committed yet </li></ul>
  6. 7. GIT staging area <ul><li>• git has a concept of a ‘staging area’ </li></ul><ul><li>• you first stage all of the changes that you </li></ul><ul><li>are happy with </li></ul><ul><li>• then you can commit the changes using commit command </li></ul>
  7. 8. Committing <ul><li>git commit -m “commit message” </li></ul><ul><li>Here commit message is used to track the cause for modifications in future. </li></ul>
  8. 9. <ul><li>Branching / Merging </li></ul>
  9. 10. Branching? <ul><li>git branch </li></ul><ul><li>git branch [new branch name] </li></ul><ul><li>git checkout [new branch name] </li></ul>
  10. 11. Merging? <ul><li>git checkout [target branch] </li></ul><ul><li>git merge [other branch] </li></ul>
  11. 12. Why branching and merging awesome? <ul><li>Git will allow you to have multiple branches for each repository that can be entirely independent of each other and the creation, merging and deletion of those lines of development take seconds. Git makes this process incredibly easy and it changes the way most developers work when they learn it. </li></ul>
  12. 13. Merging and Branching usage <ul><li>$ git checkout -b test </li></ul><ul><li>$ git commit -am &quot;Adding cutoff method to String&quot; </li></ul><ul><li>$ git checkout master </li></ul><ul><li>Switched to branch &quot;master&quot; </li></ul><ul><li>$ git merge test </li></ul>
  13. 14. Remote operations <ul><li>git push [repository] [repository branch] </li></ul><ul><li>git pull [repository] [repository branch] </li></ul>
  14. 15. Working with GIT? <ul><li>First we have to create an account in . </li></ul><ul><li>Login to github with your account details. </li></ul><ul><li>Create repository: </li></ul><ul><li>Goto Dashboard </li></ul><ul><li>New Repository </li></ul><ul><li>Give project name,description,homepageurl </li></ul><ul><li>Click on create repository. </li></ul>
  15. 16. <ul><li>To Manage(Add,Modify,Remove files) in repository we need to have private,public keys. </li></ul><ul><li>Now check the keys in your system. </li></ul><ul><li>Open Git Bash </li></ul><ul><li>Type cd ~/.ssh </li></ul><ul><li>If you get dir not found error then you have to generate the keys. </li></ul><ul><li>Type ssh-keygen -t rsa -C &quot; [email_address] &quot; </li></ul><ul><li>Now your public key has been saved in /home/venkat/.ssh/ </li></ul>
  16. 17. <ul><li>Next steps </li></ul><ul><li>Global setup: </li></ul><ul><li>1. Download and install Git software </li></ul><ul><li>2. git config --global &quot;venkat&quot; </li></ul><ul><li>3. git config --global </li></ul>
  17. 18. Process <ul><li>id_rsa is the private key and id_rsa_pub is the public key. </li></ul><ul><li>Goto Account settings -> SSH Public Keys -> Add another public key. </li></ul><ul><li>Enter title and key and press Add key. </li></ul><ul><li>Test whether it is correctly configured or not </li></ul><ul><li>$ ssh </li></ul><ul><li>Hi venkatadapa! You've successfully authenticated , </li></ul>
  18. 19. <ul><li>Local -> Remote Submition </li></ul><ul><li>mkdir Appname </li></ul><ul><li>cd Appname </li></ul><ul><li>git init </li></ul><ul><li>touch README </li></ul><ul><li>git add README </li></ul><ul><li>git commit -m 'first commit' </li></ul><ul><li>git remote add origin </li></ul><ul><li>git push origin master </li></ul>
  19. 20. <ul><li>git add . </li></ul><ul><li>git commit -m “full application submitted” </li></ul><ul><li>git push origin master </li></ul><ul><li>Now all files in your application was submitted to remote repository </li></ul>
  20. 21. Remote -> Local -> Remote <ul><li>Git clone gitrepo_url [local_dirname] </li></ul><ul><li>Cd local_dirname </li></ul><ul><li>Change some files and add new files </li></ul><ul><li>Git add [filesnames] </li></ul><ul><li>add the modified files to repository </li></ul><ul><li>Git commit -m “cause for modifications” </li></ul><ul><li>Git push origin master </li></ul>
  21. 22. Tracking <ul><li>Git –help </li></ul><ul><li>Git stash </li></ul><ul><li>No local changes to save </li></ul><ul><li>Git diff </li></ul><ul><li>will show you all modifications made on each file </li></ul><ul><li>Gti status </li></ul><ul><li>will show you any changes need to update into server </li></ul>
  22. 23. <ul><li>Git log </li></ul><ul><li>Will show you all commit messages and commiters </li></ul>
  23. 24. GOOD LUCK