Skip to content

Troubleshooting commits

On this page we cover some commonly occurring scenarios that may cause your commit to fail.

Why is pre-commit failing?

We ask that all contributors set up pre-commit hooks prior to making any commits. These pre-commit hooks perform checks to manage basic code security and catch other common problems, such as:

  • Large data files that should not be committed to the repository (files > 200 Kb)
  • Merge conflicts that have not yet been resolved
  • Credential files and other sensitive information

If you attempt to commit any file that does not meet the pre-commit requirements, then you will see a red banner indicating pre-commit failed. If this is the case, you will not be able to commit your changes until you fix the problem.

You can click the View log button on the right hand side of the pre-commit banner to see which checks failed.

Pre-commit fail

In the below example, the pre-commit failure is because we are trying to commit a file that contains credentials.

Pre-commit log

The log may also include some details on which file caused an error and the reason. Typically, this will require you to delete sensitive information or remove any large files.

Once you have identified and resolved the issue, you will need to re-add your files to the Staged files section. Then you can commit your files and pre-commit should now pass.

Pre-commit pass

Why doesn't the file I added show up in GitKraken for me to stage and commit?

In some cases, you may try to commit a file that does not show up in the Unstaged files section of GitKraken. If the file is not there, than you cannot stage it and make a commit. This is likely because Git is intentionally ignoring that file.

We have set up a .gitignore file in the root directory of this repository that will tell Git to ignore certain files. Any files with a matching extension or path listed in the .gitignore will not be allowed to be committed to the repository.

Ignored files include the following:

  • Data files, such as .rds or .h5ad files
  • Environment files, such as renv and env directories
  • Other hidden files produced by R and Python