Git: Git'ing the Basic

575
-1

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
575
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Git: Git'ing the Basic

  1. 1. Git: Giting the BasicGerald VillorenteKite Systems Inc.Drupal.IT / 06-01-2013 / Microsoft PH Makati City
  2. 2. Kite Systems Git me
  3. 3. What is Git?Git (/ t/) is a distributed revision control andɡɪsource code management (SCM) system withan emphasis on speed.[3] Initially designed anddeveloped by Linus Torvalds for Linux kerneldevelopment, Git has since been adopted bymany other projects.http://en.wikipedia.org/wiki/Git_(software)
  4. 4. Why Git?● Distributed (upstream/downstream)● Git has integrity (SHA-1)● Local and remote revisioning● Full history● Push/pull only requires internet● Fast● Its awesome!
  5. 5. Setup Git Identity● git config –global user.name “Captain Barbel”● git config –global user.email “cb@pinoyhero.net”
  6. 6. Create a New Repository● git init- Create an empty git repository or reinitialize an existingone
  7. 7. Checkout a Repository● git clone- Clone a repository into a new directory● git clone /path/to/repository● git clone username@host:/path/to/repository
  8. 8. Git Workflow
  9. 9. Add and Commit● git add- Add file contents to the index● git add <filename>● git add *● git add .● git commit- Record changes to the repository● git commit -m "Commit message"● git commit -am "Commit message"
  10. 10. Add and Commit● git add- Add file contents to the index● git add <filename>● git add *● git add .● git commit- Record changes to the repository● git commit -m "Commit message"● git commit -am "Commit message"
  11. 11. Pushing Changes● git push- Update remote refs along with associated objects● git push origin master● git push origin <branch_name>● git push <alias> <branch_name>●git push or git push <alias>
  12. 12. Adding Remote Repo Server● git remote add origin <server>● git remote add <alias> <server>
  13. 13. Branching
  14. 14. Branching● git checkout -b bayabasSwitching branch● git checkout okra● git branch -d alugbatiNOTE: a branch is not available to others unless youpush the branch to your remote repository● git push origin talong
  15. 15. Update and Merge● git pull- Fetch from and merge with another repository or a local branch● git pull origin● git pull origin <branch_name> or git pull –all● git fetch origin- Download objects and refs from another repository● git diff <source_branch> <target_branch>● git merge <branch_name>● git merge <branch_name> -m “Message”
  16. 16. Conflict during Merge● Use diff tool or “git diff” command● git add <filename>
  17. 17. Tagging● git tag 1.0.0 1b2e1d63ff
  18. 18. Replace Local Changes● git checkout -- <filename>● git pull –rebase● git reset –hard origin/<branch_name>● git clean -f
  19. 19. Git Useful Commands● git status- Show the working tree status● git log- Show commit logs● git show- Show various types of objects● git fetch- Download objects and refs from another repository● git log --oneline
  20. 20. Categorization
  21. 21. Categorization
  22. 22. Categorization
  23. 23. Categorization
  24. 24. Categorization
  25. 25. Questions?
  26. 26. References● http://rogerdudler.github.io/git-guide/● http://git-scm.com/book● https://na1.salesforce.com/help/doc/en/salesforce_● http://ndpsoftware.com/git-cheatsheet.html

×