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

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.

主站蜘蛛池模板: 和龙市| 北京市| 竹山县| 疏附县| 嘉禾县| 尼勒克县| 化德县| 会宁县| 贡嘎县| 古蔺县| 长武县| 石家庄市| 连州市| 且末县| 金寨县| 浏阳市| 武清区| 大悟县| 兴化市| 云阳县| 全椒县| 垣曲县| 岚皋县| 深圳市| 齐河县| 津市市| 屏东市| 广元市| 定结县| 吉隆县| 定安县| 四会市| 陕西省| 彰化县| 罗城| 普陀区| 靖宇县| 新蔡县| 繁昌县| 大宁县| 德令哈市|