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.

Git basics

20 views

Published on

Get to the basics of Git as a version control system

Published in: Software
  • Be the first to comment

  • Be the first to like this

Git basics

  1. 1. Git basics Working knowledge in git Anthony Eli Agbenu @_agbenu
  2. 2. Outline • Introduction • How to install Git • File lifecycle processes • How to start • Branches • Demo • Resources
  3. 3. Introduction What is Git ? • What is Git ? • What Git is not ? • Benefits of using Git ?
  4. 4. How to install Git • Recommended method is to download CLI tool https://git- scm.com/downloads • Check it works by typing git into terminal
  5. 5. Lifecycle processes Untracked Unmodified Modified Staged Localrepo Remoterepo
  6. 6. How to start Start your own repository > git init Start with some else’s repository > git clone
  7. 7. Saving files • Adding to staging area • > git add <files> or • > git add –all or • > git add . • Saving to local repo • > git commit • Saving to remote repo ( external or internal ) - > git push
  8. 8. Branches • Movable pointer to a commit • > git branch <new-branch-name> • > git checkout <existing-branch-name> • > git merge <other-branch-name>
  9. 9. DEMO • Try the following list of commands • What happens on each step
  10. 10. DEMO ( cont ) • > git clone https://github.com/agbenu/DemonstrationOnGit.git • > cd DemonstrationOnGit • > git status • > git checkout -b my-new-feature • Edit something in the file • > git status • > git add --all • > git status • > git diff HEAD • > git commit -m “Made changes to file” • > git status • > git log • > git push origin HEAD • > git checkout master • > git pull
  11. 11. Resources • https://git-scm.com/docs/

×