Skip to main content

Uploading Codes

To upload codes, you will need to create an account at OpenCSG Community. Dodes are Git-based repositories, which give you versioning, branches, discoverability and sharing features. You can upload anything you want to the code repository.

Currently, we support two ways to upload files: via Web interface and Git.

💡 Which method should I choose?​

  • Web interface: Suitable for small files; check the current upload page and deployment configuration for the per-file limit.
  • Git/CLI: Use Git LFS for large Git files, or the repository-type-specific CLI instructions where provided. Limits depend on the site and storage configuration.

Upload Files to a Repository Using Git​

Prerequisites​

  1. Install Git and Git LFS, then run git lfs install.
  2. Configure the identity used for local commits:
git config --global user.name "Your name"
git config --global user.email "you@example.com"
  1. Obtain an Access Token from Account settings → Access Token on the target deployment. Use it as the password when HTTPS Git requests credentials. Organization repositories also require write permission.

Upload Steps​

Copy the HTTPS clone URL from the current repository. Replace the sample namespace and repository; use your deployment's actual address.

git lfs install
git clone https://opencsg.com/codes/your-namespace/example-code.git
cd example-code

Copy the intended files into the local repository. Check that no credentials or unintended files are included, then commit and push:

git add .
git commit -m "Upload repository files"
git push

Verify the files and commit in the target repository's Files tab.

[Note]​

Use Git LFS for large files. Before git add, check the repository's .gitattributes. Add a tracking rule if required:

git lfs track "path/to/large-file"
git add .gitattributes

File size and timeout limits depend on site, proxy and storage configuration. Preserve the file size and error, and use a supported workflow described on this page. Site limits are not a universal Git LFS protocol limit.

Managing and Uploading Files via Web Interface​

In the repository's Files tab, select Add file, then choose New folder, Create new file, or Upload file.

The per-file limit is defined by the current upload page. For larger files, use a transfer method documented as supported on this page.

Add file

Creating a New Directory​

Select New folder, enter a name and submit to create a subfolder under the current repository path.

New folder

Creating a New File​

Select Create new file, enter the file name and content, then select Create File to save and commit it.

Create new file

Uploading a File​

Select Upload file, choose the local file and submit. Confirm that it appears in the repository file list after the upload completes.

Upload file