Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env RUBYOPT= ruby
- fail('not git dir') if !File.exists?(".git/config")
- storage = "~/tmp/gitmirror/"
- id = Dir.pwd.gsub(ENV['HOME']+"/",'').gsub(/[^\d\w]+/,'_')
- location = storage + id + ".git"
- puts "Mirror location is #{location}"
- system(%[git clone --mirror . #{location} 2>/dev/null])
- system(%[git push --mirror --force --repo=#{location}])
Add Comment
Please, Sign In to add comment