Simple script to sync ( clone, pull, commit, push) git repos.
The perfect way to start&end your day!
syncallgit.sh {optional directory}
The script
git pull
Use the {optional directory} to check a single directory - otherwise the script will use it's config files.
The script uses the following configuration files if they exist:
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"
List of (parent-) directories containing git folders to be synced.
( Suggestion: put in the loction of the "syncallgit" -git dir first )
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
Additionally, you can add the following files to your git-repositories to change the behaviour of the "git pull"
To use git pull --recurse-submodules
instead of simple git pull
To use git submodule update --recursive --remote
instead of simple git pull
Setup /root/git folder and /root/.config/git_dirs file:
mkdir /root/git
. In that folder:
git clone https://github.com/matschi-klickme/syncallgit.git
echo "/root/git" >> /root/.config/git_dirs
SSH-key based authentication needs to be set up for this
git config --global core.editor "EDITOR"
(replace with desired editor, eg "vim", "nano", etc )ssh -A root@localhost /root/git/syncallgit.sh
to auto sync repos in /root/git and all additional entries in /root/.conf/git_dirs from a regular user shell The ".gitignore" file is your friend!
Switch to ssh-key based auth to avoid annoying "please enter your account/pw" messages