Sub topic 15
Permissions and limits of Git folders
This chapter assumes you can clone a repository into a Git folder and commit, push, and pull from the workspace. It covers who can do what in a Git folder and which limits to plan around.
Two layers of access
Access to a Git folder is controlled in two places. They are independent, and an operation must pass both.
- Workspace permissions decide what a user can do with the folder inside Databricks.
- Git provider permissions decide what the user's Git credential can do on the remote repository.
A user with Can Manage on a Git folder can still fail to push if their token has only read access to the repository. The reverse also holds. A token with write access does not help a user who has only Can Read in the workspace.
Workspace permission levels
Git folders use the same access control lists as other workspace objects.
| Level | What it allows in a Git folder |
|---|---|
| No Permissions | The folder is not visible. |
| Can Read | View notebooks and files. |
| Can Run | Run notebooks, but not edit them. |
| Can Edit | Edit files and perform Git operations such as commit, push, pull, and switching branches. |
| Can Manage | Everything above, plus changing permissions and deleting the folder. |
Permissions set on a Git folder apply to the notebooks and files inside it. If you share a folder with a teammate who needs to run code but not change it, give them Can Run.
Credentials belong to the user
Git credentials are stored per user, not per folder. When you commit and push, the commit is attributed to your identity, and the provider enforces your repository permissions. Two people editing the same Git folder each need their own credential. For that reason, shared Git folders are a poor place for several people to edit at once. Each person should work in their own clone on their own branch.
Workspace admins can also restrict which remote URLs users may clone from. They can do this with an allow list. If a clone fails with a "URL not allowed" style error, the cause is an admin setting, not your credential.
Limits to plan around
Git folders are designed for source code, not data. Typical limits include:
- Size. The working branch has a total size cap of about 1 GB, and individual files have their own size cap. Check the current Databricks documentation for exact figures, because they change.
- File count. Very large repositories with many thousands of files can be slow to clone or may fail.
- Large binary files. Keep datasets, model files, and other big binaries out of the repository. Store them in cloud storage or a Unity Catalog volume instead.
- Unsupported Git features. Some features of a full Git client, such as submodules and Git LFS, are not supported. Working from the command line on your own machine remains an option for those cases.
If an operation fails because of size, the usual fix is to trim the repository or use a sparse checkout. Sparse checkout clones only the folders you need.
Exercise
A teammate has Can Manage on a Git folder, but pushing to the remote fails with an authorization error. Name two places to look.
Show answer
First, check the teammate's Git credential (the personal access token or linked account), because it may be expired or limited to read access. Second, check their permissions on the remote repository or branch, such as branch protection rules. Workspace permissions are not the cause, because Can Manage already covers Git operations.