zoukankan      html  css  js  c++  java
  • Git Learning(1)

    In Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn’t store the file again—just a link to the previous identical file it has already stored.

    Everything in Git is check-summed before it is stored and is then referred to by that checksum.  The mechanism that Git uses for this checksumming is called a SHA-1 hash. This is a 40-character string composed of hexadecimal characters (0–9 and a–f) and calculated based on the contents of a file or directory structure in Git. A SHA-1 hash looks something like this:

    24b9da6552252987aa493b52f8696cd6d3b00373

     

    When you do actions in Git, nearly all of them only add data to the Git database. 

    Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

    The Git directory is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer.

    The working directory is a single checkout of one version of the project. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.

    The staging area is a simple file, generally contained in your Git directory, that stores information about what will go into your next commit. It’s sometimes referred to as the index, but it’s becoming standard to refer to it as the staging area.

    The basic Git workflow goes something like this:

    1. You modify files in your working directory.
    2. You stage the files, adding snapshots of them to your staging area.
    3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.

    If a particular version of a file is in the git directory, it’s considered committed. If it’s modified but has been added to the staging area, it is staged. And if it was changed since it was checked out but has not been staged, it is modified. 

  • 相关阅读:
    太原市圆通快递网点
    快递单号查询小工具
    C#快递单号查询源码
    爱快递快递接口使用说明
    如何把网站及数据库部署到Windows Azure
    从window.console&&console.log(123)浅谈JS的且运算逻辑(&&)
    C# Enum 简易权限设计 使用FlagsAttribute属性
    Lambda 表达式(C# 编程指南)
    C# list使用方法
    SharePoint Server 2013介绍v2
  • 原文地址:https://www.cnblogs.com/wintor12/p/3415214.html
Copyright © 2011-2022 走看看