![]() The branch name " working-branch" corresponds to a file in the " refs/heads" directory.įor each branch in the repository, we can find a file of the same name in the " refs/heads" directory. The " HEAD" file is a small file, which has the name of the current working branch. We may be curious to know how GIT knows about all the branches. But we can give a name to it by modifying the " description" file.Įcho "git-test" > description The "HEAD" File & the "refs" Directory When we create the repository, we did not give it a name. The " description" file keeps the name of the repository. In a GIT repository, the " config" file keeps the basic configuration information related to the repository.įor example, in our repository, it has the user name and the email. Without making the effort to understand every detail related to how GIT works, it is beneficial to at least take a quick look into the ". A Little Bit in the ".git" DirectoryĪs we have known that GIT keeps all the information in the ". The " -mixed" mode is the default mode, which explains why we can use " git reset" to un-stage all the changes that we do not want to commit. Any changes to tracked files in the working tree since are discarded. The "-hard" mode - Resets the index and working tree to.The "-mixed" mode - Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated.This leaves all your changed files "Changes to be committed", as git status would put it. The "-soft" mode - Does not touch the index file or the working tree at all (but resets the head to, just like all modes do). ![]() According to the documentation, the " git reset" has three commonly used modes:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |