A Collection Of Some Commonly Used Commands
This article compiles commonly used commands when working with tools like GitHub, Jekyll, Docker, and Cloudflare Pages — for quick reference and workflow automation.
1. GitHub Commands
1.1 Force Reset to a Specific Commit
git reset --hard xxxxxxxxxx
git push origin main --force
1.2 Delete Remote and Local gh-pages
Branch
git push origin --delete gh-pages
git branch -D gh-pages # optional local delete
2. Run Jekyll Blog Locally with Docker (Orbstack)
2.1 Pull Image and Start
docker compose pull # pull official image
docker compose up # launch the blog system
2.2 Build and Clean the Site
bundle exec jekyll clean && bundle exec jekyll build
Output will be in the _site
directory, which can be tested within an Orbstack container.
3. Using CF_API_TOKEN to Delete Cloudflare Pages Projects
When a project has over 100 deployments, Cloudflare may not allow direct deletion of the Pages project. You can first delete all deployments using this workaround, and then manually delete the project.
Steps:
- Download the tool:
delete-all-deployments.zip
- Unzip and enter the directory:
cd delete-all-deployments
- Install dependencies:
npm install
- Set environment variables and run (example):
CF_API_TOKEN=your_token \ CF_ACCOUNT_ID=your_account_id \ CF_PAGES_PROJECT_NAME=your_project_name \ npm start
This will delete all deployments (excluding aliased/production deployments). You can then manually remove the project. Example: CF_API_TOKEN=xx-xxxxxxxxxx CF_ACCOUNT_ID=xxxxxxxxxx CF_PAGES_PROJECT_NAME=xx npm start
.
4. Dependency Installation
bundle install