Configuring a SourceCraft repository to support Git Large File Storage (LFS)
SourceCraft repositories support Git Large File Storage (LFS) for storing large files. We recommend using LFS for storing objects larger than 100 MB in the repository.
-
Clone the SourceCraft repository:
HTTPSSSH-
In the top-right corner of the repository page, click
Clone. -
Copy the
link for cloning the repository from the HTTPS field. -
In the terminal, run this command:
git clone <link_for_cloning_repository> -
Enter a username.
-
Specify the personal token as the password.
Tip
If you do not want to enter your username and password every time, use the following command:
git clone https://anyname:<personal_access_token>@git.sourcecraft.dev/<organization_slug>/<repository_slug>.git -
Go to your cloned repository:
cd <repository_name>
-
In the top-right corner of the repository page, click
Clone. -
Copy the
link for cloning the repository from the SSH field: -
In the terminal, run this command:
git clone <link_for_cloning_repository>To clone the repository via port 443, specify the port number in the URL:
git clone ssh://ssh.sourcecraft.dev:443/<organization_slug>/<repository_slug>.gitHere is an example:
git clone ssh://ssh.sourcecraft.dev:443/sourcecraft/sourcecraft.gitFor more information on using SSH over the HTTPS port, see this GitHub guide.
-
Go to your cloned repository:
cd <repository_name>
-
Install
git-lfs: -
Configure your repository to support LFS:
git lfs install -
Copy the files you want to store in LFS into the repository.
-
List the files for LFS storage, separating them with spaces:
git lfs track "<path_to_large_file_1>" "<path_to_large_file_2>" "<path_to_large_file_n>"Tip
You can also specify file templates to store in LFS, e.g.,
git lfs track "*.png" -
Stage the files in Git, create a commit, and push the changes to the remote repository:
git add . git commit -m "added LFS objects" git push origin main