You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,10 +47,10 @@ a separate branch in your local repository
47
47
48
48
There are different ways to check whether a file is tracked or not:
49
49
50
-
-`git ls-files <file>` -> exit code of 0 means it's tracked
51
-
-`git blame <file>`
50
+
-`git ls-files <file>` -> exit code of 0 means it's tracked
51
+
-`git blame <file>`
52
52
...
53
-
</b></details>
53
+
</b></details>
54
54
55
55
<details>
56
56
<summary>Explain what the file <code>gitignore</code> is used for</summary><br><b>
@@ -95,8 +95,8 @@ One thing to do about it, would be to use the built-in `fsmonitor` (filesystem m
95
95
96
96
Next, you can try to enable `feature.manyFile` with `git config feature.manyFiles true`. This does two things:
97
97
98
-
1. Sets `index.version = 4` which enables path-prefix compression in the index
99
-
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.
98
+
1. Sets `index.version = 4` which enables path-prefix compression in the index
99
+
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.
100
100
101
101
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.
102
102
@@ -113,10 +113,10 @@ Finally, with certain build systems, you can know which files are being used/rel
113
113
<details>
114
114
<summary>What's is the branch strategy (flow) you know?</summary><br><b>
<summary>What is the <code>.git</code> directory? What can you find there?</summary><br><b>
251
257
The <code>.git</code> 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.
252
258
253
-
254
259
This info copied from [https://stackoverflow.com/questions/29217859/what-is-the-git-folder](https://stackoverflow.com/questions/29217859/what-is-the-git-folder)
255
260
</b></details>
256
261
257
262
<details>
258
263
<summary>What are some Git anti-patterns? Things that you shouldn't do</summary><br><b>
259
264
260
-
* Not waiting too long between commits
261
-
* Not removing the .git directory :)
262
-
</b></details>
265
+
- Not waiting too long between commits
266
+
- Not removing the .git directory :)
267
+
</b></details>
263
268
264
269
<details>
265
270
<summary>How do you remove a remote branch?</summary><br><b>
@@ -334,20 +339,20 @@ Shortly, it runs `git diff` twice:
334
339
335
340
1. Compare between HEAD to staging area
336
341
2. Compare staging area to working directory
337
-
</b></details>
342
+
</b></details>
338
343
339
344
<details>
340
345
<summary>If <code>git status</code> 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? </summary><br><b>
341
346
342
347
One reason is about the structure of the index, commits, etc.
343
348
344
-
* Every file in a commit is stored in tree object
345
-
* The index is then a flattened structure of tree objects
346
-
* All files in the index have pre-computed hashes
347
-
* The diff operation then, is comparing the hashes
349
+
- Every file in a commit is stored in tree object
350
+
- The index is then a flattened structure of tree objects
351
+
- All files in the index have pre-computed hashes
352
+
- The diff operation then, is comparing the hashes
348
353
349
354
Another reason is caching
350
355
351
-
* Index caches information on working directory
352
-
* When Git has the information for certain file cached, there is no need to look at the working directory file
353
-
</b></details>
356
+
- Index caches information on working directory
357
+
- When Git has the information for certain file cached, there is no need to look at the working directory file
0 commit comments