-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-remote.rb
More file actions
executable file
·34 lines (28 loc) · 883 Bytes
/
set-remote.rb
File metadata and controls
executable file
·34 lines (28 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env ruby
# frozen_string_literal: true
ALIAS_SSH_URL = {
tea: "git@gitea.com:initd/{repo}.git",
berg: "ssh://git@codeberg.org/initd/{repo}.git",
lab: "git@gitlab.com:initdc/{repo}.git",
deb: "git@salsa.debian.org:o9/{repo}.git",
tngl: "git@tangled.sh:initd.tngl.sh/{repo}",
bsky: "git@tangled.sh:initd.bsky.social/{repo}",
hub: "git@github.com:initdc/{repo}.git",
bit: "git@bitbucket.org:initdc/{repo}.git"
# sf: "ssh://initd@git.code.sf.net/p/hello-sourceforge/code",
# az: "git@ssh.dev.azure.com:v3/asia-pacific/proj/proj"
}.freeze
REPO = Dir.pwd.split("/").last
def ps(cmd)
puts cmd
system(cmd)
end
ALIAS_SSH_URL.each do |as, url|
puts "----Runing for #{as} ---"
url = url.sub("{repo}", REPO)
ps "git remote remove #{as}"
ps "git remote add #{as} #{url}"
ps "git push #{as} --all -f"
puts "------------------------"
puts
end