Linux : Git

Srcs :Pro Git

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.

This leads us to the three main sections of a Git project: the Git directory, the working directory, and the staging area:

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:

Remember that each file in your working directory can be in one of two states:trackedoruntracked.Trackedfiles are files that were in the last snapshot; they can beunmodified,modified, orstaged.Untrackedfiles are everything else — any files in your working directory that were not in your last snapshot and are not in your staging area:

基本命令:

2.7 Git Basics – Tips and Tricks

Auto Completion

Download the Git source code, and look in thecontrib/completiondirectory; there should be a file calledgit-completion.bash. Copy this file to your home directory, and add this to your.bashrcfile:

1 source ~/.git-completion.bash,香港空间,网站空间,香港虚拟主机有时我们选择改变,并非经过深思熟虑,而更像是听见了天地间冥冥中的呼唤,

Linux : Git

相关文章:

你感兴趣的文章:

标签云: