Advertisement

Git - An Introduction

Architect (Hands On) at Wipro - Global Enterprise Architecture
Mar. 27, 2017
Advertisement

More Related Content

Advertisement

Git - An Introduction

  1. - Behzad Altaf A 2-3-5-7-11-13…-r
  2. Agenda • Version Control • What • Why • Types • How • Git • History • Fundamentals • Basic Commands • Branching • Working with remote • Further reading/ references • Tips
  3. Version Control • In computer software engineering, revision control is any kind of practice that tracks and provides control over changes to source code. • Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. https://en.wikipedia.org/wiki/Version_control
  4. Version Control – Why?
  5. Version Control – Why? http://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/
  6. Version Control – Why?
  7. Version Control - Local https://git-scm.com/book/en/v2
  8. Version Control - Centralized https://git-scm.com/book/en/v2
  9. Version Control - Distributed https://git-scm.com/book/en/v2
  10. Version Control - options
  11. What is git? Distributed Performant Reliable
  12. Git – History • The Linux kernel is an open source software project of fairly large scope. For most of the lifetime of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper. • In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool based on some of the lessons they learned while using BitKeeper. https://git-scm.com/book/en/v2
  13. Git - Data Storage Storing data as changes to a base version of each file. Storing data as snapshots of the project over time. https://git-scm.com/book/en/v2
  14. Git - The Sections https://git-scm.com/book/en/v2
  15. Git - The Sections http://www.slideshare.net/nullstein/git-usage-patterns
  16. https://git-scm.com/book/en/v2 Git - File Lifecycle
  17. GIT Installation git for Windows https://git-for-windows.github.io/ https://git-scm.com/book/en/v2
  18. Git - Commands CLONE – an existing repository
  19. Git – Basic Commands Checking status of files $ Git status Output On branch master nothing to commit, working directory clean Checking status of files – Untracked files – (Add a file to working dir.) $ Git status Output Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) New Text Document.txt nothing added to commit but untracked files present (use "git add" to track)
  20. Tracking files – Add $ git add <filename> Output On branch master nothing to commit, working directory clean Checking status of files – After adding file $ git status Output On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: <File Name> Staging Modified Files (Modify a file) If you change a previously tracked file called “CONTRIBUTING.md” and then run your git status command again, you get something that looks like this: $ git status Output Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory You have to add them again $ git add CONTRIBUTING.md Git – Basic Commands
  21. Git – Basic Commands Commit files $ git commit $ git commit –m Skipping the staging area $ git commit -a –m [applicable for tracked files] Removing File- You have to remove it from tracked files(staging area) and then commit $ git rm <<File name>> $ git commit Commit History - $ git logs Unstaging staged file $ git reset HEAD CONTRIBUTING.md Unmodifying a Modified File $ git checkout -- CONTRIBUTING.md
  22. Git - Branching
  23. Git - Merging
  24. Git – Working with remote $ git remote –v $ git remote add origin (remote name) http://github.com/somrepo.git $ git pull origin (remote) master (branch) {git fetch and merge} $ git push origin (remote) master (branch)
  25. Git - Ignoring files .gitignore
  26. Git - On the server
  27. Git - IDE Plugins
  28. Git – Online Exercises • http://pcottle.github.io/learngitBranching/ • https://try.github.io/levels/1/challenges/1 • https://www.codeschool.com/courses/git-real
  29. Git - Further Reading • PRO GIT (Beginner) https://git-scm.com/book/en/v2 • Git Pocket Guide (Advanced) http://www.amazon.in/Git-Pocket-Guide-Richard-Silverman/dp/935110236X
  30. Git - Always Remember – git never forgets! There are a lot of great things about Git, but one feature that can cause issues is the fact that a git clone downloads the entire history of the project, including every version of every file. This is fine if the whole thing is source code, because Git is highly optimized to compress that data efficiently. However, if someone at any point in the history of your project added a single huge file, every clone for all time will be forced to download that large file, even if it was removed from the project in the very next commit. Because it’s reachable from the history, it will always be there. https://rtyley.github.io/bfg-repo-cleaner/ https://git-scm.com/book/en/v2
Advertisement