官术网_书友最值得收藏!

The working directory

As we have seen in the previous chapters, getting a Git repository on your local computer is as easy as cloning a repository. The folder that serves as your Git repository is a regular folder like any other and is also known as the working directory. The magic trick is the hidden .git folder that has all the data that is necessary for Git to track your files. It allows you to execute commands, such as git status, git add, and git commit. The .git file contains your HEAD, which is basically the current state of your branch. Whenever you move commits, branch, cherry pick, or whatever, the HEAD will know your current state and what it once was. Knowing this, resetting your working directory becomes as easy as resetting your HEAD, as we will see later. It also means that you can move your current branch to another commit simply by editing your HEAD. Now, I do not recommend you go around and edit files in the .git folder, but this is exactly what Git does for you when you execute command through the command line or through other Git clients.

主站蜘蛛池模板: 苍溪县| 阜新市| 闽清县| 财经| 温州市| 济阳县| 鄢陵县| 梓潼县| 全州县| 武夷山市| 常州市| 高阳县| 广平县| 平利县| 胶南市| 黔西县| 伊吾县| 安宁市| 乌海市| 宁明县| 仪征市| 黔西| 宿州市| 天水市| 德庆县| 碌曲县| 营口市| 宜昌市| 四会市| 达孜县| 抚顺市| 张家川| 砀山县| 新化县| 赤水市| 军事| 曲麻莱县| 屯留县| 昌图县| 侯马市| 海淀区|