Git (many scripts on many boxes)

This post describes the situation when you keep different scripts on many servers and the aim is to aggregate them into one project as well as to ensure the versioning feature.

Create a repository [e.g. sdiserverapps]. Create a branch [e.g. srv2].
You have to ensure that the option “–single-branch” is available, in contrary compile git:

Download sources

yum install zlib-devel gettext-devel perl-ExtUtils-MakeMaker curl-devel  -y
# [optional] yum install -y  expat-devel zlib-devel openssl-devel

# Debian:
aptitude install zlib1g-dev libgettextpo-dev libcurl4-dev

./configure
make
make install
### when you insalled git packages before [end]
yum erase git
# logout
login
### when you insalled git packages before [end]
git --version
git version 1.8.5.2 # it means everything is ok

git clone -b srv2 --single-branch http://YOUR_USER@YOUR_HTTP_ADDRESS:7990/scm/db/sdiserverapps.git

git config --global user.name "DBA John Kovalski"
git config --global user.email dba@example.org
git config --global credential.helper 'cache --timeout=3600'

# let see the changes
git config --list

If you receive the following error it means that you cannot use the specified solution (and your dir was not empty):

git clone -b srv2 --single-branch http://YOUR_USER@YOUR_HTTP_ADDRESS:7990/scm/db/sdiserverapps.git ./
git fatal: destination path '.' already exists and is not an empty directory.

You can create the branch in the default directory and then move it:

mv -v ./sdiserverapps/.g* .
git add --all
# check whether all files are desired...
git commit --dry-run | less
git commit -m "first commit"
git push 

Check the actual branch:

git branch

Remove file from branch:

git rm --cache ./you-file.log 
  1. No comments yet.

  1. No trackbacks yet.