Giter VIP home page Giter VIP logo

git's Introduction

Git

Git for beginners This is the foundation of git. To summarize, using our photo analogy:

git init: Creates a box in which to permanently store panoramic pictures. git add: Takes a temporary photo of one thing that can be assembled into a panoramic photo later. git commit: Assembles all available temporary photos into a panoramic photo. Also destroys all temporary photos. git log: Lists all the panoramic photos we’ve ever taken. git show: Looks at what is in a particular panoramic photo. git checkout: Rearranges files back to how they looked in a given panoramic photo. Does not affect the panormiac photos in your box in any way.

image

As this figure shows, files fall into two main categories: untracked files: These files have either never been tracked or were removed from tracking. Git is not maintaining history for these files. tracked files: These files have been added to the Git repository and can be in various stages of modification: unmodified, modified, or staged. An unmodified file is one that has had no new changes since the last version of the files was added to the Git repo. A modified file is one that is different from the last one Git has saved. A staged file is one that a user has designated as part of a future commit (usually through use of the git add command). We can think of these as files which have lights shining upon them.

Rule of Thumb: If you commit, you can always revert your code or change it. However, if you don’t commit, you won’t be able to get old versions back. So commit often!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.