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
`git_checkout_options` isn't actually very optional.
1234
+
The defaults won't be useful outside of a small number of cases.
1235
+
The best example of this is `checkout_strategy`; the default value does nothing to the work tree.
1236
+
So if you want your checkout to check files out, choose an appropriate strategy.
1237
+
1238
+
* `NONE` is the equivalent of a dry run; no files will be checked out.
1239
+
* `SAFE` is similar to `git checkout`; unmodified files are updated, and modified files are left alone.
1240
+
If a file was present in the old HEAD but is missing, it's considered deleted, and won't be created.
1241
+
* `SAFE_CREATE` is similar to `git checkout-index`, or what happens after a clone.
1242
+
Unmodified files are updated, and missing files are created, but files with modifications are left alone.
1243
+
* `FORCE` is similar to `git checkout --force`; all modifications are overwritten, and all missing files are created.
1244
+
1245
+
Take a look at the [checkout header](https://github.com/libgit2/libgit2/blob/HEAD/include/git2/checkout.h#files) for extensive explanation of the checkout flags.
1246
+
1247
+
<h3 id="checkout_simple">Simple</h3>
1248
+
1249
+
```c
1250
+
/* Checkout from HEAD, something like `git checkout HEAD` */
0 commit comments