Luis atencio on_git

617 views
536 views

Published on

Little Git pitch for my team.

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

  • Be the first to like this

No Downloads
Views
Total views
617
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • TDE - Welcome everyone
  • Luis atencio on_git

    1. 1. an introduction
    2. 2. See: Resources
    3. 3. A Free and open source distributedversion control system designed tohandle everything from small to verylarge projects with speed and efficiency.Created by Linus Torvalds.
    4. 4. If you are not distributed, you are not worth using Linus Torvalds
    5. 5. If you perform badly, you are not worth using Linus Torvalds
    6. 6. If you cannot guarantee that what I check in, checks outexactly the same way, you are not worth using Linus Torvalds
    7. 7. • Distributed: no need to access a central server in order to use version control. Every revision is tracked locally. Every Git workspace is a full blown version control system• Offline: users can commit/diff and do everything offline• Merging and Branching: core of Git. Performant• Fault-tolerant: no single point of failure
    8. 8. • You cannot do partial checkouts (partial clones)• Windows support is not as great as other for OS.• No “latest version”. Git uses hashes which are unreadable for humans• No global revision numbers.
    9. 9. • Windows executable – http://git-scm.com/download/win• Linux: – http://git-scm.com/download/linux• Mac: – http://git-scm.com/download/mac – http://www.macports.org/
    10. 10. • Everyone has a local sandbox, you have your own copy of the repo• It works offline• It’s fast, performance built from the core• It handles changes well, branching and merging is core• Does not track empty folders
    11. 11. – Status = working tree status– Push = update remote refs + objs– Fetch = download remote refs + objs– pull = fetch + merge– Init = create empty git repo– Commit = record changes to repo– Add = add to index– Diff = show changes between commits and working directories– Merge = join 2+ dev histories– Clone = gives you a complete copy of that repo on your system– Branch = list/create/delete branches– Tag = list/create/delete tags …and much more
    12. 12. > git clone <repo-name>> git remote add upstream <repo-name>> mkdir src> touch main.py> git add –A> git commit –am “New source directory”> git push upstream master
    13. 13. # navigate to repo home directory> touch “.gitignore”# add file extension you with to ignore#add: # Files to exclude # ################### *.txt # exclude text files *.orig # exclude merge backups> touch ABOUT.txt> git add –A ; git commit –am “New Text file”> git push upstream master # No changes made to repo
    14. 14. # Move file> git add –A> git commit –am “Moving file”> git push upstream master
    15. 15. # Add command aliases to facilitate day to day routines.# Single command:> git config --global alias.alias command# User’s directory, create “.gitconfig” file. Example: [alias] ac = !git add -A && git commit# To verify:> git config --list
    16. 16. # Github does not support direct shell access# Must use the Github api:> curl -u ’<username> https://api.github.com/user/repos -d {"name":”<repo-name>"}’# Set up SSH keys with github, then:> git remote add origin git@github.com:<username>/<rep-name>.git> git push –u origin master ## requires SSH to be added
    17. 17. • On fork1 make change and push to master branch• Before merging in fork2, make a change on same line, commit it, and try to push to master -> rejected• Try git pull• To view change: git diff HEAD• Resolve merge with git mergetool (opendiff) -> pick change in fork2• Power command: git ac “Resolve conflict”• Use git config --global mergetool.keepBackup false to remove .orig files or add them to .gitignore• git pull on fork1 and merge changes
    18. 18. • https://help.github.com/articles/fork-a-repo• http://gitref.org/remotes/#push• https://help.github.com/• http://www.youtube.com/watch?v=4XpnKHJAok8• http://www.youtube.com/watch?v=_yQlKEq-Ueg• http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/• http://betterexplained.com/articles/a-visual-guide-to-version-control/• http://git.or.cz/course/svn.html• http://oli.jp/2012/git-powerup/

    ×