> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Work from a commit ID in Git

When you [add an external Git repository to your project](/cloud/platform-capabilities/core-concepts/projects/manage-dfs-projects/import-git-repositories), you can specify which state of the repository you want checked out by default in your runs and workspaces. You can specify a branch, tag, commit ID, or custom ref.

Commit IDs are unique SHA-1 hashes that are created whenever a new [commit](https://git-scm.com/docs/git-commit) is recorded. If you specify a commit ID when you add a repository, Domino will always pull the state of the repository specified by that commit in a [detached HEAD](https://git-scm.com/docs/git-commit) state. This represents a fixed point in the repository’s history, and will not evolve over time like a branch.

Domino cannot automatically push to repositories it has pulled in this way. If you want to push changes to such a repository, you can use the workspace command line to manually commit and push to a new branch. See [Import Git Repositories](/cloud/platform-capabilities/core-concepts/projects/manage-dfs-projects/import-git-repositories) to learn more about how to interact with Git in workspaces.

## Example

In this example, a repository called `domino-manual` was added to a project with a specified commit ID. When the workspace is started, it is pulled to `/repos/domino-manual` with the target commit checked out in a detached HEAD state. You can run `git status` to verify this in your workspace command line.

<img src="https://mintcdn.com/dominodatalab-e871cec4/vCYEw6E-fllpx-CR/images/4.x/detached-head-state.png?fit=max&auto=format&n=vCYEw6E-fllpx-CR&q=85&s=d7440ca21f2752ae35f829b442a31a9a" alt="Detached head state" width="1838" height="446" data-path="images/4.x/detached-head-state.png" />

Suppose during the course of your workspace session you make a change to the repository. It will remain in the detached HEAD state, but Git will continue to track changes.

<img src="https://mintcdn.com/dominodatalab-e871cec4/vCYEw6E-fllpx-CR/images/4.x/detached-head-state-tracking.png?fit=max&auto=format&n=vCYEw6E-fllpx-CR&q=85&s=82b2f53617cfa8aa7c4233cd483e08dc" alt="Detached head state tracking" width="1842" height="486" data-path="images/4.x/detached-head-state-tracking.png" />

You can add and commit those changes as normal.

<img src="https://mintcdn.com/dominodatalab-e871cec4/vCYEw6E-fllpx-CR/images/4.x/detached-head-state-commit.png?fit=max&auto=format&n=vCYEw6E-fllpx-CR&q=85&s=a32997bf7fabb7f5f85bcee1d0ac1118" alt="Detached head state commit" width="1844" height="532" data-path="images/4.x/detached-head-state-commit.png" />

However, if you try to push from the detached HEAD state, you will encounter a fatal error. Git must have a branch to push to.

<img src="https://mintcdn.com/dominodatalab-e871cec4/vCYEw6E-fllpx-CR/images/4.x/detached-head-state-push-error.png?fit=max&auto=format&n=vCYEw6E-fllpx-CR&q=85&s=62fcd5b3cfa719aaba6a1d7573c0842e" alt="Detached head state push error" width="1840" height="430" data-path="images/4.x/detached-head-state-push-error.png" />

The solution is to create a local branch from your detached HEAD, check it out, and push to remote with `git push -u origin`.

<img src="https://mintcdn.com/dominodatalab-e871cec4/vCYEw6E-fllpx-CR/images/4.x/detached-head-new-branch.png?fit=max&auto=format&n=vCYEw6E-fllpx-CR&q=85&s=08f72771cb89d6e7a3e484b2c304c888" alt="Detached head state new branch" width="1846" height="654" data-path="images/4.x/detached-head-new-branch.png" />
