Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction git


Published on

Introduction about git and little overview about git commands

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction git

  1. 1. GIT Introduction Version Control System Dian Sigit Prastowo & Agastyo Satriaji Idam
  2. 2. Problem
  3. 3. Version Control System “A version control system (sometimes called revision control) is a tool that lets you track the history and attribution of your project files over time (stored in a repository), and which helps the developers in the team to work together. Modern version control systems help them work simultaneously, in a non-blocking way, by giving each developer his or her own sandbox, preventing their work in progress from conflicting, and all the while providing a mechanism to merge changes and synchronize work.” “Mastering Git.”
  4. 4. Version Control System
  5. 5. What is GIT? Git is Distributed Version Control System “Distributed means that there is no main server and all of the full history of the project is available once you cloned the project”
  6. 6. A Brief History • In 2002, the Linux kernel project bega using a DVCS calld BitKeeper. • In 2005, 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 Linux Trovalds, the creator of Linux) to develop their own tool - GIT
  7. 7. First of all, definitions • Working tree A directory in your filesystem that is associated with a repository, containing files & sub-directories • Repository A collection of commits & branches, saved in the .git directory • Commit A Snapshot of your working tree at a certain point in time, identified by a revision number. • HEAD The name for the commit thats currently checked out in.
  8. 8. GIT • You can imagine git as something that sits on top of your file system and manipulates files. • This “something” is a tree structure where each commit creates a new node in that tree. • Nearly all git commands actually serve to navigate on this tree and to manipulate it accordingly.
  9. 9. GIT Commands Version Control System Dian Sigit Prastowo & Agastyo Satriaji Idam
  10. 10. Commands • git config • git init • git add • git rm • git commit • git log • git diff • git status • git reset • git branch • git checkout • git merge • git remote • git clone • git push • git pull
  11. 11. Install Git on Windows • Download the latest Git for Windows installer git • Started the installer, you should see the Git Setup wizard screen. Follow the Next and Finish prompts to complete the installation. • Open a Command Prompt (or Git Bash if during installation you elected not to use Git from the Windows Command Prompt). • Run the following commands to configure your Git username and email using the following commands: $ git config --global “Dian Sigit” $ git config --global "”
  12. 12. Configuration
  13. 13. Local Repository git init git-init - Create an empty Git repository or reinitialize an existing one
  14. 14. Local Repository git add git-add - Add file contents to the index
  15. 15. Local Repository git rm git-rm - Remove files from the working tree and from the index
  16. 16. Local Repository git commit git-commit - Record changes to the repository
  17. 17. Local Repository git commit git-commit - Record changes to the repository
  18. 18. Local Repository git log git-log - Show commit logs
  19. 19. Local Repository git diff git-diff - Show changes between commits, commit and working tree, etc
  20. 20. Local Repository git status git-status - Show the working tree status
  21. 21. Local Repository git reset git-reset - Reset current HEAD to the specified state
  22. 22. Local Repository git branch git-branch - List, create, or delete branches
  23. 23. Local Repository git checkout git-checkout - Switch branches or restore working tree files
  24. 24. Local Repository git merge git-merge - Join two or more development histories together
  25. 25. Installing SSH keys on Windows • To access your Git repositories you will need to create and install SSH keys • Generating a key pair, ssh-keygen -t rsa • Copy the public key, and paste on gitlab SSH Key Settings, cat ~/.ssh/ | clip • Checking your connection, ssh
  26. 26. Collaboration Repository git remote git-remote - Manage set of tracked repositories
  27. 27. Collaboration Repository git clone git-clone - Clone a repository into a new directory
  28. 28. Collaboration Repository git push git-push - Update remote refs along with associated objects
  29. 29. Collaboration Repository git pull git-pull - Fetch from and integrate with another repository or a local branch