mkdir ~/.git-templates
git config --global init.templatedir ~/.git-templates
git config -l
mkdir -p ~/.git-templates
tar -xvzf git-templates.tgz -C ~/.git-templates
get the url
cd ~/some-git-repo
git ls-remote --get-url 'origin'
EDIT ~/.gitconfig
and add an entry
[user "url-from--get-url"]
email = sample@eml
name = name surname
check it is working
git clone <url-from--get-url>
references: git-templates.tgz
create a repository
cd /var/git
mkdir my-new-repo.git
cd my-new-repo.git
git --bare init
/etc/apache2/conf-available/git-http.conf:
SetEnv GIT_PROJECT_ROOT /var/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend
#/usr/libexec/git-core/git-http-backend/
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR]
RewriteCond %{REQUEST_URI} /git-receive-pack$
RewriteRule ^/git/ - [E=AUTHREQUIRED:yes]
<LocationMatch "^/git/">
Order Deny,Allow
Deny from env=AUTHREQUIRED
AuthType Basic
AuthName "Git Access"
# Require group committers
# Satisfy Any
AuthUserFile /etc/apache2/passwd.git
Require valid-user
</LocationMatch>
enable the conf, create the user/password
a2enconf git-http
htpasswd -c /etc/apache2/passwd.git <user>
# restart apache
Having an alien FILE-edited.c
find which version in git repository is the most similar
git log --pretty=format:%h FILE.c | \
while read -r HASH ; do \
git checkout $HASH; \
WCL=$(diff FILE.c FILE-edited.c|wc -l); \
echo "$WCL $HASH"; done |sort |head
rsync -av "PROJECT.cvs.sourceforge.net::cvsroot/PROJECT/*" /tmp/old-cvs
cd /tmp/new-git
git cvsimport -A /tmp/names -o master -d /tmp/old-cvs module
where /tmp/names have the format:
unixname=Real Name <mail>