@git-copy/copy
v0.0.5
Published
A Git copy helper to copy code from dev repository branch to main repository with one commit.
Readme
Git-Copy Script
A utility to copy and stage files from a development branch to a release branch in Git.
Runs directly from GitHub, no clone required.
Features
- Minimal fetch (
--depth=1) for speed - Automatically stashes local changes
- Creates a clean
syncbranch for staging - Works on Linux/macOS/Git Bash/WSL and Windows PowerShell
- Supports plain alias or function (for optional future arguments)
Cross-Platform Installation
Linux / macOS / Git Bash / WSL
Option A: Plain alias (no arguments)
echo 'alias git-copy="bash -c \"$(curl -fsSL https://raw.githubusercontent.com/<YourUsername>/git-copy-script/main/git-copy.sh)\""' >> ~/.bashrc && source ~/.bashrcList all alias
alias
alias git-copygit-copyOption B: Function (supports future arguments)
echo 'git-copy() { bash -c "$(curl -fsSL https://raw.githubusercontent.com/<YourUsername>/git-copy-script/main/git-copy.sh)" "$@"; }' >> ~/.bashrc && source ~/.bashrcgit-copy # default remote
git-copy devrepo # optional remote overrideWindows PowerShell
Option A: Plain alias (no arguments)
Add-Content $PROFILE 'Set-Alias git-copy "bash -c \"$(curl -fsSL https://raw.githubusercontent.com/<YourUsername>/git-copy-script/main/git-copy.sh)\""'
. $PROFILEList all alias
Get-Alias
Get-Alias git-copygit-copyOption B: Function (supports future arguments)
Add-Content $PROFILE 'function git-copy { param([string]$remote); bash -c "$(curl -fsSL https://raw.githubusercontent.com/<YourUsername>/git-copy-script/main/git-copy.sh)" $remote }'
. $PROFILE# Create Profile If Does Not Exists
New-Item -ItemType Directory -Force -Path (Split-Path $PROFILE)git-copy
git-copy devrepoConfiguration
The script stores defaults in .git/git-copy.conf:
main_stream="origin" # release remote
main_branch="master" # release branch
dev_stream="devrepo" # dev remote
dev_branch="master" # dev branch
sync_branch="sync" # working branch