Skip to main content

Initialize Git/GitHub backup, auto backup hooks, and releases for a project.

Project description

pro-inital

pro-init turns the current directory into a Git-backed project with optional GitHub backup, automatic push hooks, idle-time auto backup, and a first GitHub Release.

Chinese documentation: README_zh.md

What it is for

Use pro-init when you start or inherit a local project and want a repeatable safety baseline:

  • initialize Git if the directory is not already a repository
  • configure Git identity when missing
  • check git, GitHub CLI gh, and Chocolatey on Windows
  • guide GitHub CLI login
  • exclude files larger than 10 MB from Git backup
  • create a GitHub remote repository when requested
  • commit the current project state
  • create a first GitHub Release when requested
  • install project-level scripts under .pro_init/
  • install a post-commit hook that pushes after every commit
  • optionally install a Windows scheduled task that watches the project and auto commits/pushes after files become idle

Install

python -m pip install pro-inital

For local wheel testing:

python -m pip install .\dist\pro_inital-0.1.4-py3-none-any.whl

Quick start

Open PowerShell in the project directory:

cd path\to\your\project
pro-init

Follow the prompts. The default flow creates a private GitHub repository and a first release.

pro-init does not ship with a default Git identity. If Git identity is missing, it asks for user.name and user.email. By default, newly entered identity is written only to the current repository; choose the global option only when that identity should apply to all repositories on the machine.

Common commands

Initialize with no GitHub remote:

pro-init --no-remote

Create a public GitHub repository instead of private:

pro-init --public

Choose a repository name:

pro-init --repo-name MyProject

Choose the first release tag:

pro-init --release-version v0.1.0

Generated files

Generated project scripts are placed under:

.pro_init/

The main generated scripts are:

  • .pro_init/git_backup.ps1: commit and push current changes
  • .pro_init/auto_backup_watch.ps1: watch files and auto backup after idle time
  • .pro_init/install_auto_backup_task.ps1: install the Windows scheduled task
  • .pro_init/create_release.ps1: create a GitHub Release from a clean working tree

Automatic backup

pro-init installs a local Git hook:

.git/hooks/post-commit

The hook pushes automatically after each commit, but only when origin exists.

If you accept the scheduled task prompt, a Windows task starts the watcher after login. The watcher waits until file activity has been idle, then runs:

git add .
git commit -m "Auto backup <timestamp>"
git push

This is designed for small project code changes. Keep generated build outputs ignored.

Large file rule

Files larger than 10 MB are written to .gitignore before backup. The generated backup script also rescans for new large files before committing.

This avoids accidentally committing maps, datasets, bitstreams, videos, logs, or archives. Use Git LFS or external storage for large artifacts.

Release policy

Automatic backups are for history and recovery. Releases should represent stable milestones.

Create a release manually from a clean repository:

.\.pro_init\create_release.ps1 -Version v0.1.1 -Title "Stable milestone"

Requirements

  • Python 3.9+
  • Windows PowerShell for auto-install and scheduled-task features
  • Git
  • GitHub CLI gh
  • Chocolatey only when git or gh need to be installed automatically on Windows

Troubleshooting

Check GitHub login:

gh auth status

Check remote:

git remote -v

Check current Git state:

git status

Start the generated watcher task manually:

Start-ScheduledTask -TaskName "ProInit_AutoBackup_<project_name>"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pro_inital-0.1.4-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pro_inital-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pro_inital-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pro_inital-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d488d24269c81f417e554395aa73e8d9234d0c361cc1735d7d17ea57bbf2ded6
MD5 f3b53a41775c1765a8f0db55ce45fa8c
BLAKE2b-256 ac2000c0b646125f3b9ba6a5e4876816f68dc5d665fbbd1a7888c8586d376683

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page