Git Note

.git目录中各个文件和目录的作用:

HEAD

指向当前分支,是一个指向你当前所在分支的引用标识符,这样的引用标识符——它看起来并不像一个普通的引用——其实并不包含 SHA-1 值,而是一个指向另外一个引用的指针

branches/
config

包含了项目特有的配置选项

description

仅供 GitWeb 程序使用的描述信息

hooks/

保存了客户端或服务端钩子脚本

index

保存了暂存区域信息

info/

保存了一份不希望在 .gitignore 文件中管理的忽略模式 (ignored patterns) 的全局可执行文件

objects/

存储所有数据内容 refs/ 存储指向数据 (分支) 的提交对象的指针

/heads

保存指向分支的提交对象的指针,文件名为分支名,内容为某个提交对象的SHA-1值

/tags

像是一个分支引用,不会变化——永远指向同一个 commit,仅仅是提供一个更加友好的名字

/remotes

是标记这些分支在服务器上最后状态的一种书签

Git 以一种类似 UNIX 文件系统但更简单的方式来存储内容。所有内容以 tree 或 blob 对象存储,其中:

  1. tree 对象对应于 UNIX 中的目录,

  2. blob 对象则大致对应于 inodes 或文件内容。
  3. commit (提交) 对象,用于记录快照的的SHA-1值,提交者,何时提交,提交原因等信息
  4. Tag 对象非常像一个 commit 对象——包含一个标签,一组数据,一个消息和一个指针。最主要的区别就是 Tag 对象指向一个 commit (也可以是其他任何git对象)而不是一个 tree。它就像是一个分支引用,但是不会变化——永远指向同一个 commit,仅仅是提供一个更加友好的名字

一个单独的 tree 对象包含一条或多条 tree 记录,每一条记录含有一个指向 blob 或子 tree 对象的 SHA-1 指针,并附有该对象的权限模式 (mode)、类型和文件名信息

时间: 2024-10-03 05:53:01

Git Note的相关文章

Git Note - git tag

git tag is used to create labels, usually for version numbers. Format: git tag <TagName> <refer> Example: git tag v0.1 HEAD is to create a version number v0.1 on current HEAD. Notice: When you git push your code to remote server, you need to a

Git Note - Branch

1. add a new branch cd workspace git branch user1/newbranch1 git checkout user1/newbranch1 or git checkout -b user2/newbranch2 2. when user1/newbranch1 development finished, merge it into master branch. git checkout master git merge user1/newbranch1

git workflows

https://www.atlassian.com/git/tutorials/comparing-workflows Comparing Workflows The array of possible workflows can make it hard to know where to begin when implementing Git in the workplace. This page provides a starting point by surveying the most

how to install git 1.8 rpm

git版本在低于1.8之前,对于私有项目会出现401的pull失败错误,只能通过升级git版本来解决 It appears that git18 is no longer available from RPMForge, at least in CentOS 6.6. Luckily, I came across the following instructions from a GitLab CentOS recipe: Download PUIAS repo: wget -O /etc/yu

转-git feature branch workflow

https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow Getting Started Setting up a repository git init git clone git config Saving changes git add git commit Inspecting a repository git status git log Viewing old commits

JQuery -&gt; 超级简单的下拉菜单

1. create a new accout, create orginazation, create repo 2. install git in your local pc Note: you can create ssh key to avoid username/password input for github operation https://help.github.com/articles/generating-ssh-keys https://help.github.com/a

LeetCode: Swap Nodes in Pairs [023]

1. create a new accout, create orginazation, create repo 2. install git in your local pc Note: you can create ssh key to avoid username/password input for github operation https://help.github.com/articles/generating-ssh-keys https://help.github.com/a

github basic usage

1. create a new accout, create orginazation, create repo 2. install git in your local pc Note: you can create ssh key to avoid username/password input for github operation https://help.github.com/articles/generating-ssh-keys https://help.github.com/a

Build Android Webrtc Libjingle Library On Ubuntu

Recently, our team is developing an app to help people solve problem face to face. We choose webrtc protocol as our bridge among different platform(Android, iOS, browser etc). But there is a hole in Android 6.0 system, the protocol can not support An