代码网
DEVELOPER DOCUMENTATION

Get started with Codebucket

Manage projects with standard Git workflows, or create repositories and upload files from the web. This guide covers the most common tasks.

New repository

Get started #

Create a repository first. Its Clone or push panel provides the Git URL used in the examples below.

1Create a repositoryName your project and add a description
2Copy the Git URLFind it on the repository page
3Make your first commitPush with Git or upload from the web
Need Git?
Install a Git client for Windows, macOS or Linux before using the command-line workflow.

Use the website #

Create a repository

  1. Sign in and select New from the top navigation.
  2. Enter a repository name, identifier and description.
  3. Open the repository to upload files or copy its Git URL.

Upload and edit files

Select Upload on a repository page to add one or more files. Text files can also be previewed and edited online. Use Git pushes for larger or long-running projects so every change has a commit history.

Clone a public repository #

Public repositories can be cloned without signing in.

Bash
git clone https://daimawang.com/git/your-user/repository.git
cd repository

After cloning, enter the project directory to inspect files, create branches and continue development.

Push a local project #

For a project that is not yet connected to a remote repository, run these commands from its root directory.

Bash
# Run from your project directory
git init
git add -A
git commit -m "Initial commit"
git branch -M master
git remote add origin https://daimawang.com/git/your-user/repository.git
git push -u origin master
If an origin remote already exists, do not add it again.
Update it with git remote set-url origin YOUR_GIT_URL, then run git push -u origin master.

Use your user ID as the Git username. A Git Push Token is recommended instead of your daily sign-in password.

Authentication #

Cloning public repositories needs no authentication. Pushing code, creating releases and other write actions require an authenticated account.

Create and revoke Git Push Tokens from Account settings. Treat tokens like passwords and revoke unused tokens immediately.

Daily workflow #

For each change, stage, commit and push. Pull before collaborating to reduce merge conflicts.

Bash
git add -A
git commit -m "Describe the change"
git push

Releases #

Create a release from the repository’s Releases page when a version is ready to share. Use a clear version tag and include release notes describing changes and known limitations.

Troubleshooting #

Authentication failed or HTTP 401

Confirm that you used your user ID rather than display name. Use a valid Git Push Token and create a new one if it expired or was revoked.

Permission denied or HTTP 403

Check that the remote URL belongs to your repository and that you are signed in to the correct account. Only repository owners can push.

Push was rejected

Pull remote changes first, resolve any conflicts, then push again.