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. 

  • 相关阅读:
    ASP.NET获取服务器信息
    检测到有潜在危险的 Request.Form 值错误解决办法
    修改sql server数据库逻辑文件名的语句
    遍历类的所有属性和根据属性名动态设置属性值
    JS三种编解码方式
    获取QQ群用户列表
    关于字符串类型相关的问题总结
    学习C++之父的最新姐妹作笔记1
    【转】 Uniode TO ANSI 转换函数封装
    添加工具栏图标按钮(转)
  • 原文地址:https://www.cnblogs.com/wintor12/p/3415214.html
Copyright © 2011-2022 走看看