--- layout: default menu_item: api title: Checkout description: Version 0.26.1 menu_item: api return_to: "API Documentation Index": /api/ sections: "head": "#head" "index": "#index" "tree": "#tree" "NOTIFY": "#NOTIFY" "STRATEGY": "#STRATEGY" --- ## Checkout.head Async ```js Checkout.head(repo, [options]).then(function() { // checkout complete }); ``` Patch head checkout to automatically coerce objects. | Parameters | Type | | | --- | --- | --- | | repo | [Repository](/api/repository/) | The repo to checkout head | | [options] | [CheckoutOptions](/api/checkout_options/) | Options for the checkout | ## Checkout.index Async ```js Checkout.index(repo, index, [options]).then(function() { // checkout complete }); ``` Patch index checkout to automatically coerce objects. | Parameters | Type | | | --- | --- | --- | | repo | [Repository](/api/repository/) | The repo to checkout an index | | index | [Index](/api/index/) | The index to checkout | | [options] | [CheckoutOptions](/api/checkout_options/) | Options for the checkout | ## Checkout.tree Async ```js Checkout.tree(repo, treeish, [options]).then(function() { // checkout complete }); ``` Patch tree checkout to automatically coerce objects. | Parameters | Type | | | --- | --- | --- | | repo | [Repository](/api/repository/) | | | treeish | String, [Tree](/api/tree/), [Commit](/api/commit/), [Reference](/api/reference/) | | | [options] | [CheckoutOptions](/api/checkout_options/) | | ## Checkout.NOTIFY ENUM | Flag | Value | | --- | --- | --- | | Checkout.NOTIFY.NONE | 0 | | Checkout.NOTIFY.CONFLICT | 1 | | Checkout.NOTIFY.DIRTY | 2 | | Checkout.NOTIFY.UPDATED | 4 | | Checkout.NOTIFY.UNTRACKED | 8 | | Checkout.NOTIFY.IGNORED | 16 | | Checkout.NOTIFY.ALL | 65535 | ## Checkout.STRATEGY ENUM | Flag | Value | | --- | --- | --- | | Checkout.STRATEGY.NONE | 0 | | Checkout.STRATEGY.SAFE | 1 | | Checkout.STRATEGY.FORCE | 2 | | Checkout.STRATEGY.RECREATE_MISSING | 4 | | Checkout.STRATEGY.ALLOW_CONFLICTS | 16 | | Checkout.STRATEGY.REMOVE_UNTRACKED | 32 | | Checkout.STRATEGY.REMOVE_IGNORED | 64 | | Checkout.STRATEGY.UPDATE_ONLY | 128 | | Checkout.STRATEGY.DONT_UPDATE_INDEX | 256 | | Checkout.STRATEGY.NO_REFRESH | 512 | | Checkout.STRATEGY.SKIP_UNMERGED | 1024 | | Checkout.STRATEGY.USE_OURS | 2048 | | Checkout.STRATEGY.USE_THEIRS | 4096 | | Checkout.STRATEGY.DISABLE_PATHSPEC_MATCH | 8192 | | Checkout.STRATEGY.SKIP_LOCKED_DIRECTORIES | 262144 | | Checkout.STRATEGY.DONT_OVERWRITE_IGNORED | 524288 | | Checkout.STRATEGY.CONFLICT_STYLE_MERGE | 1048576 | | Checkout.STRATEGY.CONFLICT_STYLE_DIFF3 | 2097152 | | Checkout.STRATEGY.DONT_REMOVE_EXISTING | 4194304 | | Checkout.STRATEGY.DONT_WRITE_INDEX | 8388608 | | Checkout.STRATEGY.UPDATE_SUBMODULES | 65536 | | Checkout.STRATEGY.UPDATE_SUBMODULES_IF_CHANGED | 131072 |