Thanks to visit codestin.com
Credit goes to lib.rs

#git-remote #git #ssh

app forcegit

Sync .git directories to remote machines

1 unstable release

Uses new Rust 2024

0.1.0 Jan 7, 2026

#2088 in Command line utilities

MIT license

12KB
223 lines

forcegit

A command-line tool to sync .git directories to remote machines via SSH.

Installation

cargo install --path .

Usage

Configure a directory

Run forcegit in a project directory to configure its remote:

cd myproject
forcegit
# Enter remote [user@]host:path: user@server:/home/user/myproject

If no user is specified, the current user is used.

Sync .git to remote

forcegit sync

This will:

  1. Create a tar archive of .git
  2. Copy it to the remote via scp
  3. Extract it on the remote, replacing any existing .git

Compare commits

forcegit diff

Shows the local and remote HEAD commits.

Shell autocompletion

# Bash
eval "$(forcegit auto bash)"

# Zsh
eval "$(forcegit auto zsh)"

# Fish
forcegit auto fish | source

Configuration

Configuration is stored in ~/.config/forcegit/config.toml:

[directories.myproject]
host = "server"
path = "/home/user/myproject"
user = "user"  # optional

License

MIT.

Dependencies

~2–13MB
~101K SLoC