git directory
, working directory
and staging area
git pull
and git fetch
?gitignore
is used forgitignore
files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use git rm --cached.
git status
does?Next, you can try to enable `feature.manyFile` with `git config feature.manyFiles true`. This does two things: 1. Sets `index.version = 4` which enables path-prefix compression in the index 2. Sets `core.untrackedCache=true` which by default is set to `keep`. The untracked cache is quite important concept. What it does is to record the mtime of all the files and directories in the working directory. This way, when time comes to iterate over all the files and directories, it can skip those whom mtime wasn't updated. Before enabling it, you might want to run `git update-index --test-untracked-cache` to test it out and make sure mtime operational on your system. Git also has the built-in `git-maintainence` command which optimizes Git repository so it's faster to run commands like `git add` or `git fatch` and also, the git repository takes less disk space. It's recommended to run this command periodically (e.g. each day). In addition, track only what is used/modified by developers - some repositories may include generated files that are required for the project to run properly (or support certain accessibility options), but not actually being modified by any way by the developers. In that case, tracking them is futile. In order to avoid populating those file in the working directory, one can use the `sparse checkout` feature of Git. Finally, with certain build systems, you can know which files are being used/relevant exactly based on the component of the project that the developer is focusing on. This, together with the `sparse checkout` can lead to a situation where only a small subset of the files are being populated in the working directory. Making commands like `git add`, `git status`, etc. really quick
```
git checkout main
git pull
git checkout devel
git merge main
```
git branch
git branch
how does Git know the SHA-1 of the last commit?unstaged
means in regards to Git?git checkout some_branch
, Git updates .git/HEAD to /refs/heads/some_branch
First, you open the files which are in conflict and identify what are the conflicts.
Next, based on what is accepted in your company or team, you either discuss with your
colleagues on the conflicts or resolve them by yourself
After resolving the conflicts, you add the files with `git add
git reset
and git revert
?`git revert` creates a new commit which undoes the changes from last commit. `git reset` depends on the usage, can modify the index or change the commit which the branch head is currently pointing at.
git rebase
?.git
directory? What can you find there?.git
folder contains all the information that is necessary for your project in version control and all the information about commits, remote repository address, etc. All of them are present in this folder. It also contains a log that stores your commit history so that you can roll back to history.
This info copied from [https://stackoverflow.com/questions/29217859/what-is-the-git-folder](https://stackoverflow.com/questions/29217859/what-is-the-git-folder)
git rm
git diff-index HEAD
or git diff HEAD
git status
has to run diff on all the files in the HEAD commit to those in staging area/index and another one on staging area/index and working directory, how is it fairly fast?