Created
November 25, 2011 16:59
-
-
Save abstraktor/1393972 to your computer and use it in GitHub Desktop.
create an hosted git repo without server (dirty!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# this will create a new repo | |
# to be continued | |
abort "usage: create-repo <name>\nthe group git-<name> should exist" if ARGV.count != 1 | |
dirname = "%s.git" % ARGV[0] | |
groupname="git-%s" % ARGV[0] | |
domain = "timum.de" | |
Dir.chdir "/var/git" do | |
system "mkdir #{dirname}" and | |
system "cp -r preset/.git #{dirname}/.git" and | |
#system "chown :#{groupname} -R #{dirname}" and | |
system "chmod g+rws -R #{dirname}" and | |
puts "now execute this:\n git clone ssh://%s@%s/var/git/%s" % [%x[whoami].strip, domain, dirname] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# setup / reinit of this installation: | |
# sudo chmod g+rwxs * .* -R | |
# sudo addgroup git-timum-prototype | |
# # for all users that should have (write) access to this repo, do | |
# sudo adduser somebody git-timum-prototype | |
# sudo chown :git-timum-prototype * .* -R | |
cd .. | |
#thats dirty: | |
chmod ug+rwx . -R 2> /dev/null | |
echo "resetting working tree hard in `pwd`" | |
#whatever | |
#so is this: | |
unset GIT_DIR | |
git reset --hard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[branch "master"] | |
[receive] | |
denyCurrentBranch = ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment