Skip to content

A collection of powerful CLI tools and scripts for streamlined Git workflow, repository management, and shell productivity.

License

Notifications You must be signed in to change notification settings

xaoscience/git-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

git-control

GitHub repo GitHub release License

CI Status Issues Pull Requests Stars Forks

Last Commit Repo Size Code Size Contributors

Stability Maintenance Shell


πŸ› οΈ A collection of powerful CLI tools and scripts for streamlined Git workflow, repository management, and shell productivity.


πŸ“‹ Table of Contents


πŸ” Overview

Git-Control is a comprehensive toolkit designed to enhance your Git and shell workflow. It provides:

  • Alias Management: Interactive setup of productivity-boosting shell aliases
  • Template Loading: Quick initialisation of new repositories with standardised templates
  • Module Nesting: Automated management of Git submodules in complex project hierarchies
  • Workflow Templates: Pre-configured GitHub Actions for common automation tasks

Why git-control?

Managing multiple repositories, nested submodules, and maintaining consistent configurations across projects is time-consuming and error-prone. Git-Control automates these tasks while remaining portable and easy to share across systems.


✨ Features

  • πŸš€ Interactive Alias Installer - Dynamically detects script paths and creates portable aliases
  • πŸ”§ Template System - Initialise repos with docs, workflows, and configuration templates
  • πŸ“¦ Submodule Management - Auto-generate and maintain .gitmodules for nested repos
  • πŸ”’ Safety Aliases - Protective wrappers for dangerous commands (rm, mv, cp)
  • ⚑ Git Shortcuts - Optimised aliases for common Git operations
  • 🐳 Container Shortcuts - Quick access to Docker/Podman commands
  • 🌐 Network Utilities - IP checking, port monitoring, and connectivity tools
  • πŸ“ Directory Operations - Enhanced navigation and file management

πŸ“₯ Installation

Prerequisites

  • Bash 4.0+ or Zsh
  • Git 2.0+
  • Standard Unix utilities (find, sed, grep)

Quick Start

# Clone the repository
git clone https://github.com/xaoscience/git-control.git
cd git-control

# Run the interactive alias installer
./scripts/alias-loading.sh

# Or run individual scripts
./scripts/template-loading.sh
./scripts/module-nesting.sh

Manual Installation

# Add to your .bashrc or .bash_profile
source /path/to/git-control/scripts/alias-loading.sh --source-only

πŸš€ Usage

Alias Loading

# Interactive installation - choose which alias categories to install
./scripts/alias-loading.sh

# Categories available:
# 1. Git Control (gc-*)   - git-control specific commands
# 2. Git Shortcuts        - gs, ga, gc, gp, gl, etc.
# 3. Safety Nets          - rm -i, cp -i, mv -i
# 4. System Monitoring    - ports, meminfo, disk
# 5. Directory Operations - md, rd
# 6. Network Utilities    - myip, ping, fastping
# 7. Container Shortcuts  - dps, dpsa, drm, drmi
# 8. Quick Edits          - bashrc, reload

Template Loading

Allows for creation of new $NAME-templates folders, which will be copied by default.

# Interactive mode - initialise a new repo with templates
gc-init

# Or run directly
./scripts/template-loading.sh

# CLI mode - update specific files with path support
./scripts/template-loading.sh -f docs/CONTRIBUTING.md,docs/SECURITY.md -o

# CLI options:
#   -f, --files FILE1,FILE2    Process specific files (supports paths like docs/FILE.md)
#   -o, --overwrite            Overwrite existing files without prompting
#   -h, --help                 Show help and list available templates

Repository Creation

# Interactive creation of new GitHub repository
gc-create

# Or run directly
./scripts/create-repo.sh

Pull Request Creation

# Interactive creation of pull request from current branch
gc-pr

# Or run directly
./scripts/create-pr.sh

Module Nesting

# Scan current directory for git repos and generate .gitmodules
gc-modules

# Or run directly
./scripts/module-nesting.sh

# Specify a custom root directory
./scripts/module-nesting.sh /path/to/project

πŸ“œ Scripts

Script Description
alias-loading.sh Interactive alias installer with category selection
template-loading.sh Repository template initialisation tool
create-repo.sh Interactive GitHub repository creator
create-pr.sh Interactive pull request creator
module-nesting.sh Automated .gitmodules generator for nested repos

Doc Templates

Template Description
README.md Full-featured README with badges and sections
CONTRIBUTING.md Contribution guidelines template
CODE_OF_CONDUCT.md Community code of conduct
SECURITY.md Security policy template

License Templates

Template Description
Apache License 2.0 Permissive with explicit patent grant and NOTICE handling
BSD 3-Clause Permissive license with non-endorsement clause
GNU GPL v3.0 Strong copyleft β€” modifications must be released under GPLv3
MIT License Very permissive, minimal requirements

GitHub Templates

Template Description
ISSUE_TEMPLATE/bug_report.md Bug report issue template
ISSUE_TEMPLATE/feature_request.md Feature request issue template
PULL_REQUEST_TEMPLATE.md Pull request template

Workflow Templates

Workflow Description
dependabot-automerge.yml Auto-merge Dependabot PRs
init.yml Standalone workflow - copy to any repo
remote-init.yml Calls the reusable workflow remotely

Workflows

Workflow Description
central-loader.yml Reusable workflow (call from other repos)

πŸ”„ GitHub Actions Workflows

Git-Control provides two ways to initialise templates via GitHub Actions:

Option 1: Standalone Workflow (Recommended)

Copy workflows-templates/init.yml to your repo's .github/workflows/ folder.

# From your target repository
mkdir -p .github/workflows
curl -sL https://raw.githubusercontent.com/xaoscience/git-control/main/workflows-templates/init.yml \
  -o .github/workflows/init.yml
git add .github/workflows/init.yml
git commit -m "Add template initialisation workflow"
git push

Then go to Actions β†’ Initialise Repository Templates β†’ Run workflow

Option 2: Reusable Workflow (Remote)

Copy workflows-templates/remote-init.yml or call git-control's reusable workflow directly:

# .github/workflows/remote-init.yml
name: Initialise Documentation

on:
  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  init-templates:
    uses: xaoscience/git-control/.github/workflows/central-loader.yml@main
    with:
      project_name: 'My Project'
      short_description: 'A cool project'
      license_type: 'MIT'
      stability: 'experimental'
      templates: 'all'
      create_pr: true

Workflow Features

  • βœ… No PAT required - Uses standard GITHUB_TOKEN
  • βœ… Creates PR by default - Review before merging
  • βœ… Configurable - Choose templates, license, stability
  • βœ… Auto-populates - Fills in repo name, org, URLs automatically
  • βœ… Dynamic folders - Scans all *-templates folders for future expansion

πŸ“š Documentation

Document Description
πŸ“– README This file - project overview
🀝 Contributing How to contribute
πŸ“œ Code of Conduct Community guidelines
πŸ”’ Security Security policy

🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See also: Code of Conduct | Security Policy


πŸ—ΊοΈ Roadmap

  • Core alias loading script with interactive selection
  • Template system for repository documentation
  • Submodule nesting management
  • Dependabot automerge workflow
  • GitHub Actions workflow for remote template initialisation
  • Reusable workflow for cross-repo template loading
  • Zsh compatibility layer
  • Fish shell support
  • GUI wrapper (optional)
  • Plugin system for custom alias categories
  • Config file support for persistent preferences

See the open issues for a full list of proposed features and known issues.


πŸ’¬ Support


πŸ“„ License

Distributed under the GPL-3.0 License. See LICENSE for more information.


⬆️ Back to Top

About

A collection of powerful CLI tools and scripts for streamlined Git workflow, repository management, and shell productivity.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages