Menu

Tree [b31018] master /
 History

HTTPS access


File Date Author Commit
 examples 2011-01-21 Daniel Blaschke Daniel Blaschke [ab325c] patch to gitsync 1.2.2
 man-page 2013-01-14 Daniel Blaschke Daniel Blaschke [672da7] patch to 1.2.4
 README 2013-01-14 Daniel Blaschke Daniel Blaschke [672da7] patch to 1.2.4
 RelNotes.txt 2013-01-14 Daniel Blaschke Daniel Blaschke [672da7] patch to 1.2.4
 gitsync 2014-02-22 Daniel Blaschke Daniel Blaschke [57aecf] added preliminary support for multiple remotes
 gpl-license 2013-01-14 Daniel Blaschke Daniel Blaschke [672da7] patch to 1.2.4

Read Me

==========================================
   HOW TO USE GITSYNC
==========================================

GitSync is a shell script designed to simplify the usage of the version control 
system git (see www.git-scm.com for more information) for people who don't want 
to worry about several commands (such as git-add, git-commit, git-pull and 
git-push) all the time, but "just want to synchronize" their repository.

Of course, when using GitSync, you are not as flexible as with the separate git 
commands in the sense that GitSync always commits/syncs everything (apart from 
the exceptions defined in the file ".gitignore", and unless the option -f is 
used as explained below). 
Therefore, GitSync does not replace git-commit, etc., but is meant to "complete"
the set of commands by providing a "do everything to sync my repository" 
command.


INSTALLING
------------------------------------------
In order to use GitSync, the version control system "git" must be installed. In 
order to do so, download and install from its homepage www.git-scm.com.
Afterwards, follow these instructions:

Linux/Unix: Copy the file "gitsync" to /usr/bin/ or /usr/local/bin/
            To also install the manual, copy the file "gitsync.1.gz", which is 
            located in the subfolder "man-page" of this package, to 
            /usr/share/man/man1/ or /usr/local/share/man/man1/

            In case you do not have administrator privileges, you can also copy
            "gitsync" to your home directory, i.e. ~/bin/ (create that folder, 
            if it does not exist). Then make sure that folder is added to PATH 
            by adding a line "export PATH=$PATH:$HOME/bin" to either 
            "~/.profile" or "~/.bashrc".

Windows - msysGit: Just copy the file "gitsync" to "C:\Program Files\git\bin\"

Windows - Cygwin:  Copy the file "gitsync" to "C:\cygwin\usr\bin\"
                   Optionally, the manual "gitsync.1.gz", which is located 
                   in the subfolder "man-page" of this package, may be copied
                   to "C:\cygwin\usr\share\man\man1\"
                   (The gitsync-manual essentially contains the same information
                   as this README-file, except for the install-instructions.)


OPTIONS
------------------------------------------
GitSync can be invoked with the following syntax:
gitsync -m 'commit Message' -f 'Files to add' /location/of/repository
(gitsync -h/--help prints usage-info and exits)

All parameters are optional, i.e. when the -m option is omitted, you are asked 
for a commit message later in the script. (Depending on the configuration of
USE_EDITOR as mentioned below, a text editor is opened for this purpose.)
If the -f option is omitted, everything will be synced. (Otherwise, only the 
list of files/folders provided with that option will be considered).
If the location/of/repository parameter (which is always the last!) is omitted, 
the present folder is assumed to contain the repository (i.e. the location ".").


CONFIGURATION
------------------------------------------
The script offers several options defined by configuration variables. Their 
default values can be overridden by creating a GitSync-configuration file 
"gitsync.conf" directly in your repository folder, i.e. the one containing 
the sub-folder ".git".
Alternatively - or additionally - you may also create a file ".gitsync.conf" 
in your home-directory, which will be parsed before the other one.
(Usually that folder is "/home/username/" on UNIX/Linux systems, as well as in 
the Cygwin-environment on Windows. In the msysGit-Version of Git for Windows, 
that folder is "c:\Documents and Settings\username".) 


Syntax of gitsync.conf (as shown in the sample file ./examples/gitsync.conf):
VARIABLE_NAME value
Comments are ignored and should start with #.

The following variables - default values are on the left hand side - may be 
adjusted to your needs:

GIT_SERVER="auto" .......................... Change to "yes" or "no" if you want
                      to override auto-detection, i.e. "no" if you don't have 
                      a git server and only want to use git locally. (GitSync 
                      will then omit the calls "git pull" and "git push".)
                      Note, that if nothing has changed locally, GitSync will 
                      still call "git pull" to download the latest version 
                      from your git server, if GIT_SERVER="yes".

USE_EDITOR="no" .......................... Change to "yes" if you would like to 
                      use a text editor for providing git-commit comments. 
                      Optionally, "yes" can also be replaced by the name of 
                      your favourite editor to use instead of your systems
                      default.
                      Additionally, it is also possible to provide a comment 
                      as an optional argument when calling the script: For 
                      example, you may use the command
                      gitsync -m 'this is a comment'
                      which then passes your comment on to git-commit. (When 
                      merely calling "gitsync" you are asked to provide 
                      a comment during runtime.)

GIT_DIR=".git" .......................... Only change if you invoked the 
                      "git init" command with the $GIT_DIR environment 
                      variable of git set to something else than the default.
                      
GARBAGE_COLLECT="yes"  ................... If turned on, automatic garbage 
                      collection (i.e. 'git gc --auto') will be run in order 
                      to cleanup and optimize your local repository whenever 
                      this becomes necessary. Change to "no" to deactivate. 

CUSTOM_START_SCRIPT="" ................... Change to the name of a custom script
                      that you would like to call before the actual syncing
                      with GitSync. The variable may contain an absolute path, 
                      or a path relative to the location of your git repository.
                      (Note that currently no arguments can be passed to the 
                      custom script, i.e. no blanks allowed in this variable.)

CUSTOM_END_SCRIPT="" ..................... Change to the name of a custom script
                      that you would like to call after the actual syncing
                      with GitSync. The variable may contain an absolute path, 
                      or a path relative to the location of your git repository.
                      (Note that currently no arguments can be passed to the 
                      custom script, i.e. no blanks allowed in this variable.)

VERBOSITY="on" ..................... Change to "off" for silent runs.
                        

last change to this file: 2013-01-12
(C) 2010-2013: Daniel Blaschke
(C) 2009: Daniel Blaschke and Rene Sedmik 
http://www.gitsync.sourceforge.net