Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

improved way of resetting git

  • Loading branch information...
commit 98bb8f3e43dce03428715512101e0403b44b67b2 1 parent b3f97fb
Laurens Rietveld authored

Showing 1 changed file with 23 additions and 6 deletions. Show diff stats Hide diff stats

  1. +23 6 bin/master/resetNode.php
29 bin/master/resetNode.php
@@ -9,12 +9,9 @@
9 9 shell_exec("echo '' > ".$config['master']['serializationDir']."/".$config['serializationMode']['dumpFile']);
10 10 //echo "\tGIT dir (incl push/commit)\n";
11 11 $gitDir = $config['master']['git']['dir']."/".$config['master']['git']['repoDir'];
12   - `cd $gitDir; git reset .;`;
13   - foreach (scandir($gitDir) as $item) {
14   - if ($item == '.' || $item == '..' || $item == '.git') continue;
15   - shell_exec("rm ".$gitDir.DIRECTORY_SEPARATOR.$item);
16   - }
17   - `cd $gitDir; git pull -q origin master;git add .; git commit -qam "cleaning dir"; git push -q origin master`;
  12 + `cd $gitDir; rm -rf ./* .git;git init;`;
  13 + file_put_contents($gitDir."/.git/config", $gitConfig);
  14 + `cd $gitDir; touch placeholder;git add placeholder;git commit placeholder -m "sdf";git push;`;
18 15 //echo "\tDB\n";
19 16 $db = mysql_connect("localhost:3306", "syncProject");
20 17 if (!$db) die('Could not connect: ' . mysql_error());
@@ -25,3 +22,23 @@
25 22 $uri = $config['master']['tripleStore']['clearStoreUri'];
26 23 $fields = array('context' => '');
27 24 doPost($uri, $fields);
  25 +
  26 +
  27 +
  28 +
  29 +
  30 +
  31 +
  32 +
  33 + $gitConfig =
  34 +'[core]\n
  35 +repositoryformatversion = 0\n
  36 +filemode = true\n
  37 +bare = false\n
  38 +logallrefupdates = true\n
  39 +[remote "origin"]\n
  40 +url = lrd900@gitServer:syncProject\n
  41 +fetch = +refs/heads/*:refs/remotes/origin/*\n
  42 +[branch "master"]\n
  43 +remote = origin\n
  44 +merge = refs/heads/master';

0 comments on commit 98bb8f3

Please sign in to comment.
Something went wrong with that request. Please try again.