matschi-klickme / syncallgit

script to sync git repos
0 stars 0 forks source link

syncallgit

Simple script to sync ( clone, pull, commit, push) git repos.

The perfect way to start&end your day!

Usage

syncallgit.sh {optional directory}

The script

Use the {optional directory} to check a single directory - otherwise the script will use it's config files.

Config

The script uses the following configuration files if they exist:

$HOME/.config/git_links.d directory:

For folders that contain files telling where to put which repo if it doesn't yet exist in filesystem

git_links.d/ FOLDERNAME/ filename.conf

Syntax for files: "full targetpath" "link for cloning"

$HOME/.config/git_dirs file:

List of (parent-) directories containing git folders to be synced.

( Suggestion: put in the loction of the "syncallgit" -git dir first )

$HOME/.config/syncallgit_editor_cmd file:

The command to edit git comments - as a workaround to issues with gpg signed commits, when git's default core.editor config might cause input problems.

Default: xterm -e vim Suggested Alternatives: gedit -s

config file options for git directories:

Additionally, you can add the following files to your git-repositories to change the behaviour of the "git pull"

.pull_submodules

To use git pull --recurse-submodules instead of simple git pull

.submodule_update_recursive

To use git submodule update --recursive --remote instead of simple git pull

Example: Updating root-owned directories from user shell

Setup /root/git folder and /root/.config/git_dirs file:

option #1: via ssh -A root@localhost

SSH-key based authentication needs to be set up for this

Avoid annoying stuff:

untracked files:

The ".gitignore" file is your friend!

Authentication:

Switch to ssh-key based auth to avoid annoying "please enter your account/pw" messages