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

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.

主站蜘蛛池模板: 墨玉县| 汉源县| 翁牛特旗| 宝应县| 焉耆| 思茅市| 石棉县| 天气| 灌阳县| 怀安县| 平原县| 马尔康县| 通州区| 时尚| 遂溪县| 裕民县| 舟山市| 化州市| 宜章县| 宣城市| 玉树县| 海安县| 宁波市| 靖安县| 泌阳县| 洪雅县| 双柏县| 乐都县| 武平县| 鞍山市| 霍州市| 故城县| 武邑县| 剑川县| 东乡县| 右玉县| 华池县| 波密县| 屏东县| 巫溪县| 孝昌县|